Class: OCI::MediaServices::Models::MediaWorkflowTask

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/media_services/models/media_workflow_task.rb

Overview

Defines the type of processing to be run at a given point in the workflow, parameters to configure the processing, and any processing that must be completed before this processing begins.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ MediaWorkflowTask

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :type (String)

    The value to assign to the #type property

  • :version (Integer)

    The value to assign to the #version property

  • :key (String)

    The value to assign to the #key property

  • :prerequisites (Array<String>)

    The value to assign to the #prerequisites property

  • :enable_parameter_reference (String)

    The value to assign to the #enable_parameter_reference property

  • :enable_when_referenced_parameter_equals (Hash<String, Object>)

    The value to assign to the #enable_when_referenced_parameter_equals property

  • :parameters (Hash<String, Object>)

    The value to assign to the #parameters property



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/oci/media_services/models/media_workflow_task.rb', line 98

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.type = attributes[:'type'] if attributes[:'type']

  self.version = attributes[:'version'] if attributes[:'version']

  self.key = attributes[:'key'] if attributes[:'key']

  self.prerequisites = attributes[:'prerequisites'] if attributes[:'prerequisites']

  self.enable_parameter_reference = attributes[:'enableParameterReference'] if attributes[:'enableParameterReference']

  raise 'You cannot provide both :enableParameterReference and :enable_parameter_reference' if attributes.key?(:'enableParameterReference') && attributes.key?(:'enable_parameter_reference')

  self.enable_parameter_reference = attributes[:'enable_parameter_reference'] if attributes[:'enable_parameter_reference']

  self.enable_when_referenced_parameter_equals = attributes[:'enableWhenReferencedParameterEquals'] if attributes[:'enableWhenReferencedParameterEquals']

  raise 'You cannot provide both :enableWhenReferencedParameterEquals and :enable_when_referenced_parameter_equals' if attributes.key?(:'enableWhenReferencedParameterEquals') && attributes.key?(:'enable_when_referenced_parameter_equals')

  self.enable_when_referenced_parameter_equals = attributes[:'enable_when_referenced_parameter_equals'] if attributes[:'enable_when_referenced_parameter_equals']

  self.parameters = attributes[:'parameters'] if attributes[:'parameters']
end

Instance Attribute Details

#enable_parameter_referenceString

Allows this task to be conditionally enabled. If no value or a blank value is given, the task is unconditionally enbled. Otherwise the given string specifies a parameter of the job created for this task's workflow using the JSON pointer syntax. The JSON pointer is validated when a job is created from the workflow of this task.

Returns:

  • (String)


38
39
40
# File 'lib/oci/media_services/models/media_workflow_task.rb', line 38

def enable_parameter_reference
  @enable_parameter_reference
end

#enable_when_referenced_parameter_equalsHash<String, Object>

Used in conjunction with enableParameterReference to conditionally enable a task. When a job is created from the workflow of this task, the task will only be enabled if the value of the parameter specified by enableParameterReference is equal to the value of this property. This property must be prenset if and only if a enableParameterReference is given. The value is a JSON node.

Returns:

  • (Hash<String, Object>)


46
47
48
# File 'lib/oci/media_services/models/media_workflow_task.rb', line 46

def enable_when_referenced_parameter_equals
  @enable_when_referenced_parameter_equals
end

#keyString

[Required] A unique identifier for this task within its workflow. Keys are used to reference a task within workflows and MediaWorkflowJobs. Tasks are referenced as prerequisites and to track output and state.

Returns:

  • (String)


26
27
28
# File 'lib/oci/media_services/models/media_workflow_task.rb', line 26

def key
  @key
end

#parametersHash<String, Object>

[Required] Data specifiying how this task is to be run. The data is a JSON object that must conform to the JSON Schema specified by the parameters of the MediaWorkflowTaskDeclaration this task references. The parameters may contain values or references to other parameters.

Returns:

  • (Hash<String, Object>)


53
54
55
# File 'lib/oci/media_services/models/media_workflow_task.rb', line 53

def parameters
  @parameters
end

#prerequisitesArray<String>

Keys to the other tasks in this workflow that must be completed before execution of this task can begin.

Returns:

  • (Array<String>)


31
32
33
# File 'lib/oci/media_services/models/media_workflow_task.rb', line 31

def prerequisites
  @prerequisites
end

#typeString

[Required] The type of process to run at this task. Refers to the name of a MediaWorkflowTaskDeclaration.

Returns:

  • (String)


16
17
18
# File 'lib/oci/media_services/models/media_workflow_task.rb', line 16

def type
  @type
end

#versionInteger

[Required] The version of the MediaWorkflowTaskDeclaration.

Returns:

  • (Integer)


20
21
22
# File 'lib/oci/media_services/models/media_workflow_task.rb', line 20

def version
  @version
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/oci/media_services/models/media_workflow_task.rb', line 56

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'type',
    'version': :'version',
    'key': :'key',
    'prerequisites': :'prerequisites',
    'enable_parameter_reference': :'enableParameterReference',
    'enable_when_referenced_parameter_equals': :'enableWhenReferencedParameterEquals',
    'parameters': :'parameters'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/oci/media_services/models/media_workflow_task.rb', line 71

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'String',
    'version': :'Integer',
    'key': :'String',
    'prerequisites': :'Array<String>',
    'enable_parameter_reference': :'String',
    'enable_when_referenced_parameter_equals': :'Hash<String, Object>',
    'parameters': :'Hash<String, Object>'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/oci/media_services/models/media_workflow_task.rb', line 134

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    type == other.type &&
    version == other.version &&
    key == other.key &&
    prerequisites == other.prerequisites &&
    enable_parameter_reference == other.enable_parameter_reference &&
    enable_when_referenced_parameter_equals == other.enable_when_referenced_parameter_equals &&
    parameters == other.parameters
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/oci/media_services/models/media_workflow_task.rb', line 170

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


150
151
152
# File 'lib/oci/media_services/models/media_workflow_task.rb', line 150

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



159
160
161
# File 'lib/oci/media_services/models/media_workflow_task.rb', line 159

def hash
  [type, version, key, prerequisites, enable_parameter_reference, enable_when_referenced_parameter_equals, parameters].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



203
204
205
206
207
208
209
210
211
212
# File 'lib/oci/media_services/models/media_workflow_task.rb', line 203

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



197
198
199
# File 'lib/oci/media_services/models/media_workflow_task.rb', line 197

def to_s
  to_hash.to_s
end