Class: OCI::DataScience::Models::PipelineStepRun

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_science/models/pipeline_step_run.rb

Overview

Detail of each StepRun. This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class

Constant Summary collapse

STEP_TYPE_ENUM =
[
  STEP_TYPE_ML_JOB = 'ML_JOB'.freeze,
  STEP_TYPE_CUSTOM_SCRIPT = 'CUSTOM_SCRIPT'.freeze,
  STEP_TYPE_CONTAINER = 'CONTAINER'.freeze,
  STEP_TYPE_DATAFLOW = 'DATAFLOW'.freeze,
  STEP_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_WAITING = 'WAITING'.freeze,
  LIFECYCLE_STATE_ACCEPTED = 'ACCEPTED'.freeze,
  LIFECYCLE_STATE_IN_PROGRESS = 'IN_PROGRESS'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_SUCCEEDED = 'SUCCEEDED'.freeze,
  LIFECYCLE_STATE_CANCELING = 'CANCELING'.freeze,
  LIFECYCLE_STATE_CANCELED = 'CANCELED'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_SKIPPED = 'SKIPPED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PipelineStepRun

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :step_type (String)

    The value to assign to the #step_type property

  • :time_started (DateTime)

    The value to assign to the #time_started property

  • :time_finished (DateTime)

    The value to assign to the #time_finished property

  • :step_name (String)

    The value to assign to the #step_name property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :lifecycle_details (String)

    The value to assign to the #lifecycle_details property



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 116

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.step_type = attributes[:'stepType'] if attributes[:'stepType']

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

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

  self.time_started = attributes[:'timeStarted'] if attributes[:'timeStarted']

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

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

  self.time_finished = attributes[:'timeFinished'] if attributes[:'timeFinished']

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

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

  self.step_name = attributes[:'stepName'] if attributes[:'stepName']

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

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

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

  self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']

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

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

Instance Attribute Details

#lifecycle_detailsString

Details of the state of the step run.

Returns:

  • (String)


56
57
58
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 56

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

The state of the step run.

Returns:

  • (String)


52
53
54
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 52

def lifecycle_state
  @lifecycle_state
end

#step_nameString

[Required] The name of the step.

Returns:

  • (String)


48
49
50
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 48

def step_name
  @step_name
end

#step_typeString

[Required] The type of step.

Returns:

  • (String)


36
37
38
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 36

def step_type
  @step_type
end

#time_finishedDateTime

The date and time the pipeline step run finshed executing in the timestamp format defined by RFC3339.

Returns:

  • (DateTime)


44
45
46
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 44

def time_finished
  @time_finished
end

#time_startedDateTime

[Required] The date and time the pipeline step run was started in the timestamp format defined by RFC3339.

Returns:

  • (DateTime)


40
41
42
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 40

def time_started
  @time_started
end

Class Method Details

.attribute_mapObject

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



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 59

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'step_type': :'stepType',
    'time_started': :'timeStarted',
    'time_finished': :'timeFinished',
    'step_name': :'stepName',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_details': :'lifecycleDetails'
    # rubocop:enable Style/SymbolLiteral
  }
end

.get_subtype(object_hash) ⇒ Object

Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.



91
92
93
94
95
96
97
98
99
100
101
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 91

def self.get_subtype(object_hash)
  type = object_hash[:'stepType'] # rubocop:disable Style/SymbolLiteral

  return 'OCI::DataScience::Models::PipelineContainerStepRun' if type == 'CONTAINER'
  return 'OCI::DataScience::Models::PipelineCustomScriptStepRun' if type == 'CUSTOM_SCRIPT'
  return 'OCI::DataScience::Models::PipelineMLJobStepRun' if type == 'ML_JOB'
  return 'OCI::DataScience::Models::PipelineDataflowStepRun' if type == 'DATAFLOW'

  # TODO: Log a warning when the subtype is not found.
  'OCI::DataScience::Models::PipelineStepRun'
end

.swagger_typesObject

Attribute type mapping.



73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 73

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'step_type': :'String',
    'time_started': :'DateTime',
    'time_finished': :'DateTime',
    'step_name': :'String',
    'lifecycle_state': :'String',
    'lifecycle_details': :'String'
    # 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



192
193
194
195
196
197
198
199
200
201
202
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 192

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

  self.class == other.class &&
    step_type == other.step_type &&
    time_started == other.time_started &&
    time_finished == other.time_finished &&
    step_name == other.step_name &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_details == other.lifecycle_details
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



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 227

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


207
208
209
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 207

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



216
217
218
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 216

def hash
  [step_type, time_started, time_finished, step_name, lifecycle_state, lifecycle_details].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



260
261
262
263
264
265
266
267
268
269
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 260

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



254
255
256
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 254

def to_s
  to_hash.to_s
end