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_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



112
113
114
115
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
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 112

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)


54
55
56
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 54

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

The state of the step run.

Returns:

  • (String)


50
51
52
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 50

def lifecycle_state
  @lifecycle_state
end

#step_nameString

[Required] The name of the step.

Returns:

  • (String)


46
47
48
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 46

def step_name
  @step_name
end

#step_typeString

[Required] The type of step.

Returns:

  • (String)


34
35
36
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 34

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)


42
43
44
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 42

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)


38
39
40
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 38

def time_started
  @time_started
end

Class Method Details

.attribute_mapObject

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



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

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.



89
90
91
92
93
94
95
96
97
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 89

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

  return 'OCI::DataScience::Models::PipelineCustomScriptStepRun' if type == 'CUSTOM_SCRIPT'
  return 'OCI::DataScience::Models::PipelineMLJobStepRun' if type == 'ML_JOB'

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

.swagger_typesObject

Attribute type mapping.



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

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



188
189
190
191
192
193
194
195
196
197
198
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 188

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



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

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


203
204
205
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 203

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



212
213
214
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 212

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



256
257
258
259
260
261
262
263
264
265
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 256

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



250
251
252
# File 'lib/oci/data_science/models/pipeline_step_run.rb', line 250

def to_s
  to_hash.to_s
end