Class: HatchetSdkRest::StepRun

Inherits:
Object
  • Object
show all
Defined in:
lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ StepRun

Initializes the object

Parameters:

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

    Model attributes in the form of hash



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 174

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `HatchetSdkRest::StepRun` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `HatchetSdkRest::StepRun`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'metadata')
    self. = attributes[:'metadata']
  else
    self. = nil
  end

  if attributes.key?(:'tenant_id')
    self.tenant_id = attributes[:'tenant_id']
  else
    self.tenant_id = nil
  end

  if attributes.key?(:'job_run_id')
    self.job_run_id = attributes[:'job_run_id']
  else
    self.job_run_id = nil
  end

  if attributes.key?(:'step_id')
    self.step_id = attributes[:'step_id']
  else
    self.step_id = nil
  end

  if attributes.key?(:'status')
    self.status = attributes[:'status']
  else
    self.status = nil
  end

  if attributes.key?(:'job_run')
    self.job_run = attributes[:'job_run']
  end

  if attributes.key?(:'step')
    self.step = attributes[:'step']
  end

  if attributes.key?(:'child_workflows_count')
    self.child_workflows_count = attributes[:'child_workflows_count']
  end

  if attributes.key?(:'parents')
    if (value = attributes[:'parents']).is_a?(Array)
      self.parents = value
    end
  end

  if attributes.key?(:'child_workflow_runs')
    if (value = attributes[:'child_workflow_runs']).is_a?(Array)
      self.child_workflow_runs = value
    end
  end

  if attributes.key?(:'worker_id')
    self.worker_id = attributes[:'worker_id']
  end

  if attributes.key?(:'input')
    self.input = attributes[:'input']
  end

  if attributes.key?(:'output')
    self.output = attributes[:'output']
  end

  if attributes.key?(:'requeue_after')
    self.requeue_after = attributes[:'requeue_after']
  end

  if attributes.key?(:'result')
    self.result = attributes[:'result']
  end

  if attributes.key?(:'error')
    self.error = attributes[:'error']
  end

  if attributes.key?(:'started_at')
    self.started_at = attributes[:'started_at']
  end

  if attributes.key?(:'started_at_epoch')
    self.started_at_epoch = attributes[:'started_at_epoch']
  end

  if attributes.key?(:'finished_at')
    self.finished_at = attributes[:'finished_at']
  end

  if attributes.key?(:'finished_at_epoch')
    self.finished_at_epoch = attributes[:'finished_at_epoch']
  end

  if attributes.key?(:'timeout_at')
    self.timeout_at = attributes[:'timeout_at']
  end

  if attributes.key?(:'timeout_at_epoch')
    self.timeout_at_epoch = attributes[:'timeout_at_epoch']
  end

  if attributes.key?(:'cancelled_at')
    self.cancelled_at = attributes[:'cancelled_at']
  end

  if attributes.key?(:'cancelled_at_epoch')
    self.cancelled_at_epoch = attributes[:'cancelled_at_epoch']
  end

  if attributes.key?(:'cancelled_reason')
    self.cancelled_reason = attributes[:'cancelled_reason']
  end

  if attributes.key?(:'cancelled_error')
    self.cancelled_error = attributes[:'cancelled_error']
  end
end

Instance Attribute Details

#cancelled_atObject

Returns the value of attribute cancelled_at.



62
63
64
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 62

def cancelled_at
  @cancelled_at
end

#cancelled_at_epochObject

Returns the value of attribute cancelled_at_epoch.



64
65
66
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 64

def cancelled_at_epoch
  @cancelled_at_epoch
end

#cancelled_errorObject

Returns the value of attribute cancelled_error.



68
69
70
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 68

def cancelled_error
  @cancelled_error
end

#cancelled_reasonObject

Returns the value of attribute cancelled_reason.



66
67
68
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 66

def cancelled_reason
  @cancelled_reason
end

#child_workflow_runsObject

Returns the value of attribute child_workflow_runs.



36
37
38
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 36

def child_workflow_runs
  @child_workflow_runs
end

#child_workflows_countObject

Returns the value of attribute child_workflows_count.



32
33
34
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 32

def child_workflows_count
  @child_workflows_count
end

#errorObject

Returns the value of attribute error.



48
49
50
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 48

def error
  @error
end

#finished_atObject

Returns the value of attribute finished_at.



54
55
56
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 54

def finished_at
  @finished_at
end

#finished_at_epochObject

Returns the value of attribute finished_at_epoch.



56
57
58
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 56

def finished_at_epoch
  @finished_at_epoch
end

#inputObject

Returns the value of attribute input.



40
41
42
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 40

def input
  @input
end

#job_runObject

Returns the value of attribute job_run.



28
29
30
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 28

def job_run
  @job_run
end

#job_run_idObject

Returns the value of attribute job_run_id.



22
23
24
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 22

def job_run_id
  @job_run_id
end

#metadataObject

Returns the value of attribute metadata.



18
19
20
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 18

def 
  @metadata
end

#outputObject

Returns the value of attribute output.



42
43
44
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 42

def output
  @output
end

#parentsObject

Returns the value of attribute parents.



34
35
36
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 34

def parents
  @parents
end

#requeue_afterObject

Returns the value of attribute requeue_after.



44
45
46
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 44

def requeue_after
  @requeue_after
end

#resultObject

Returns the value of attribute result.



46
47
48
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 46

def result
  @result
end

#started_atObject

Returns the value of attribute started_at.



50
51
52
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 50

def started_at
  @started_at
end

#started_at_epochObject

Returns the value of attribute started_at_epoch.



52
53
54
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 52

def started_at_epoch
  @started_at_epoch
end

#statusObject

Returns the value of attribute status.



26
27
28
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 26

def status
  @status
end

#stepObject

Returns the value of attribute step.



30
31
32
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 30

def step
  @step
end

#step_idObject

Returns the value of attribute step_id.



24
25
26
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 24

def step_id
  @step_id
end

#tenant_idObject

Returns the value of attribute tenant_id.



20
21
22
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 20

def tenant_id
  @tenant_id
end

#timeout_atObject

Returns the value of attribute timeout_at.



58
59
60
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 58

def timeout_at
  @timeout_at
end

#timeout_at_epochObject

Returns the value of attribute timeout_at_epoch.



60
61
62
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 60

def timeout_at_epoch
  @timeout_at_epoch
end

#worker_idObject

Returns the value of attribute worker_id.



38
39
40
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 38

def worker_id
  @worker_id
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 469

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = HatchetSdkRest.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



125
126
127
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 125

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



130
131
132
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 130

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



93
94
95
96
97
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
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 93

def self.attribute_map
  {
    :'metadata' => :'metadata',
    :'tenant_id' => :'tenantId',
    :'job_run_id' => :'jobRunId',
    :'step_id' => :'stepId',
    :'status' => :'status',
    :'job_run' => :'jobRun',
    :'step' => :'step',
    :'child_workflows_count' => :'childWorkflowsCount',
    :'parents' => :'parents',
    :'child_workflow_runs' => :'childWorkflowRuns',
    :'worker_id' => :'workerId',
    :'input' => :'input',
    :'output' => :'output',
    :'requeue_after' => :'requeueAfter',
    :'result' => :'result',
    :'error' => :'error',
    :'started_at' => :'startedAt',
    :'started_at_epoch' => :'startedAtEpoch',
    :'finished_at' => :'finishedAt',
    :'finished_at_epoch' => :'finishedAtEpoch',
    :'timeout_at' => :'timeoutAt',
    :'timeout_at_epoch' => :'timeoutAtEpoch',
    :'cancelled_at' => :'cancelledAt',
    :'cancelled_at_epoch' => :'cancelledAtEpoch',
    :'cancelled_reason' => :'cancelledReason',
    :'cancelled_error' => :'cancelledError'
  }
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



445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 445

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



167
168
169
170
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 167

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 135

def self.openapi_types
  {
    :'metadata' => :'APIResourceMeta',
    :'tenant_id' => :'String',
    :'job_run_id' => :'String',
    :'step_id' => :'String',
    :'status' => :'StepRunStatus',
    :'job_run' => :'JobRun',
    :'step' => :'Step',
    :'child_workflows_count' => :'Integer',
    :'parents' => :'Array<String>',
    :'child_workflow_runs' => :'Array<String>',
    :'worker_id' => :'String',
    :'input' => :'String',
    :'output' => :'String',
    :'requeue_after' => :'Time',
    :'result' => :'Object',
    :'error' => :'String',
    :'started_at' => :'Time',
    :'started_at_epoch' => :'Integer',
    :'finished_at' => :'Time',
    :'finished_at_epoch' => :'Integer',
    :'timeout_at' => :'Time',
    :'timeout_at_epoch' => :'Integer',
    :'cancelled_at' => :'Time',
    :'cancelled_at_epoch' => :'Integer',
    :'cancelled_reason' => :'String',
    :'cancelled_error' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 399

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
       == o. &&
      tenant_id == o.tenant_id &&
      job_run_id == o.job_run_id &&
      step_id == o.step_id &&
      status == o.status &&
      job_run == o.job_run &&
      step == o.step &&
      child_workflows_count == o.child_workflows_count &&
      parents == o.parents &&
      child_workflow_runs == o.child_workflow_runs &&
      worker_id == o.worker_id &&
      input == o.input &&
      output == o.output &&
      requeue_after == o.requeue_after &&
      result == o.result &&
      error == o.error &&
      started_at == o.started_at &&
      started_at_epoch == o.started_at_epoch &&
      finished_at == o.finished_at &&
      finished_at_epoch == o.finished_at_epoch &&
      timeout_at == o.timeout_at &&
      timeout_at_epoch == o.timeout_at_epoch &&
      cancelled_at == o.cancelled_at &&
      cancelled_at_epoch == o.cancelled_at_epoch &&
      cancelled_reason == o.cancelled_reason &&
      cancelled_error == o.cancelled_error
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



540
541
542
543
544
545
546
547
548
549
550
551
552
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 540

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


432
433
434
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 432

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



438
439
440
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 438

def hash
  [, tenant_id, job_run_id, step_id, status, job_run, step, child_workflows_count, parents, child_workflow_runs, worker_id, input, output, requeue_after, result, error, started_at, started_at_epoch, finished_at, finished_at_epoch, timeout_at, timeout_at_epoch, cancelled_at, cancelled_at_epoch, cancelled_reason, cancelled_error].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 309

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @metadata.nil?
    invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
  end

  if @tenant_id.nil?
    invalid_properties.push('invalid value for "tenant_id", tenant_id cannot be nil.')
  end

  if @job_run_id.nil?
    invalid_properties.push('invalid value for "job_run_id", job_run_id cannot be nil.')
  end

  if @step_id.nil?
    invalid_properties.push('invalid value for "step_id", step_id cannot be nil.')
  end

  if @status.nil?
    invalid_properties.push('invalid value for "status", status cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



516
517
518
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 516

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



522
523
524
525
526
527
528
529
530
531
532
533
534
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 522

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



510
511
512
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 510

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



337
338
339
340
341
342
343
344
345
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/step_run.rb', line 337

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @metadata.nil?
  return false if @tenant_id.nil?
  return false if @job_run_id.nil?
  return false if @step_id.nil?
  return false if @status.nil?
  true
end