Class: RelentlessIdentity::ClientBackgroundJobItemResponse

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/relentless_identity/models/client_background_job_item_response.rb

Overview

One item inside a background job payload.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ ClientBackgroundJobItemResponse

Initializes the object

Parameters:

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

    Model attributes in the form of hash



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
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
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 144

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `RelentlessIdentity::ClientBackgroundJobItemResponse` 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 `RelentlessIdentity::ClientBackgroundJobItemResponse`. 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?(:'id')
    self.id = attributes[:'id']
  else
    self.id = nil
  end

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

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

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

  if attributes.key?(:'input')
    if (value = attributes[:'input']).is_a?(Hash)
      self.input = value
    end
  else
    self.input = nil
  end

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

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

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

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

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

  if attributes.key?(:'charge_micros')
    self.charge_micros = attributes[:'charge_micros']
  else
    self.charge_micros = 0
  end

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

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

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

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

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

Instance Attribute Details

#charge_microsObject

Returns the value of attribute charge_micros.



40
41
42
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 40

def charge_micros
  @charge_micros
end

#completed_atObject

Returns the value of attribute completed_at.



46
47
48
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 46

def completed_at
  @completed_at
end

#created_atObject

Returns the value of attribute created_at.



48
49
50
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 48

def created_at
  @created_at
end

#error_messageObject

Returns the value of attribute error_message.



42
43
44
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 42

def error_message
  @error_message
end

#idObject

Returns the value of attribute id.



19
20
21
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 19

def id
  @id
end

#inputObject

Original submitted input for this item.



28
29
30
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 28

def input
  @input
end

#item_indexObject

Returns the value of attribute item_index.



21
22
23
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 21

def item_index
  @item_index
end

#providerObject

Returns the value of attribute provider.



38
39
40
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 38

def provider
  @provider
end

#request_typeObject

Returns the value of attribute request_type.



25
26
27
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 25

def request_type
  @request_type
end

#resolved_addressObject

Returns the value of attribute resolved_address.



36
37
38
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 36

def resolved_address
  @resolved_address
end

#resultObject

Returns the value of attribute result.



30
31
32
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 30

def result
  @result
end

#result_outcomeObject

Returns the value of attribute result_outcome.



34
35
36
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 34

def result_outcome
  @result_outcome
end

#result_stateObject

Returns the value of attribute result_state.



32
33
34
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 32

def result_state
  @result_state
end

#started_atObject

Returns the value of attribute started_at.



44
45
46
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 44

def started_at
  @started_at
end

#statusObject

Returns the value of attribute status.



23
24
25
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 23

def status
  @status
end

#updated_atObject

Returns the value of attribute updated_at.



50
51
52
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 50

def updated_at
  @updated_at
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



97
98
99
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 97

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



102
103
104
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 102

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 75

def self.attribute_map
  {
    :'id' => :'id',
    :'item_index' => :'item_index',
    :'status' => :'status',
    :'request_type' => :'request_type',
    :'input' => :'input',
    :'result' => :'result',
    :'result_state' => :'result_state',
    :'result_outcome' => :'result_outcome',
    :'resolved_address' => :'resolved_address',
    :'provider' => :'provider',
    :'charge_micros' => :'charge_micros',
    :'error_message' => :'error_message',
    :'started_at' => :'started_at',
    :'completed_at' => :'completed_at',
    :'created_at' => :'created_at',
    :'updated_at' => :'updated_at'
  }
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



417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 417

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



129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 129

def self.openapi_nullable
  Set.new([
    :'result',
    :'result_state',
    :'result_outcome',
    :'resolved_address',
    :'provider',
    :'error_message',
    :'started_at',
    :'completed_at',
  ])
end

.openapi_typesObject

Attribute type mapping.



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 107

def self.openapi_types
  {
    :'id' => :'String',
    :'item_index' => :'Integer',
    :'status' => :'String',
    :'request_type' => :'String',
    :'input' => :'Hash<String, Object>',
    :'result' => :'Hash<String, Object>',
    :'result_state' => :'String',
    :'result_outcome' => :'String',
    :'resolved_address' => :'String',
    :'provider' => :'String',
    :'charge_micros' => :'Integer',
    :'error_message' => :'String',
    :'started_at' => :'Time',
    :'completed_at' => :'Time',
    :'created_at' => :'Time',
    :'updated_at' => :'Time'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 381

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      item_index == o.item_index &&
      status == o.status &&
      request_type == o.request_type &&
      input == o.input &&
      result == o.result &&
      result_state == o.result_state &&
      result_outcome == o.result_outcome &&
      resolved_address == o.resolved_address &&
      provider == o.provider &&
      charge_micros == o.charge_micros &&
      error_message == o.error_message &&
      started_at == o.started_at &&
      completed_at == o.completed_at &&
      created_at == o.created_at &&
      updated_at == o.updated_at
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


404
405
406
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 404

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



410
411
412
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 410

def hash
  [id, item_index, status, request_type, input, result, result_state, result_outcome, resolved_address, provider, charge_micros, error_message, started_at, completed_at, created_at, updated_at].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 245

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

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

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

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

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

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

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

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



439
440
441
442
443
444
445
446
447
448
449
450
451
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 439

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

#valid?Boolean

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

Returns:

  • (Boolean)

    true if the model is valid



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/relentless_identity/models/client_background_job_item_response.rb', line 281

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @id.nil?
  return false if @item_index.nil?
  return false if @status.nil?
  status_validator = EnumAttributeValidator.new('String', ["queued", "processing", "completed", "error", "canceled"])
  return false unless status_validator.valid?(@status)
  return false if @request_type.nil?
  request_type_validator = EnumAttributeValidator.new('String', ["finder", "probe"])
  return false unless request_type_validator.valid?(@request_type)
  return false if @input.nil?
  result_outcome_validator = EnumAttributeValidator.new('String', ["found", "not_found", "error"])
  return false unless result_outcome_validator.valid?(@result_outcome)
  return false if @created_at.nil?
  return false if @updated_at.nil?
  true
end