Class: RelentlessIdentity::ClientRequestHistoryItem

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

Overview

One completed direct request visible in the user’s request history.

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 = {}) ⇒ ClientRequestHistoryItem

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 152

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

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

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

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

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

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

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

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

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

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

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

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

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

  if attributes.key?(:'is_alias')
    self.is_alias = attributes[:'is_alias']
  else
    self.is_alias = false
  end

  if attributes.key?(:'is_catchall')
    self.is_catchall = attributes[:'is_catchall']
  else
    self.is_catchall = false
  end

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

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

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



55
56
57
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 55

def created_at
  @created_at
end

#duration_msObject

Returns the value of attribute duration_ms.



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

def duration_ms
  @duration_ms
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#identity_providersObject

Returns the value of attribute identity_providers.



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

def identity_providers
  @identity_providers
end

#input_domainObject

Returns the value of attribute input_domain.



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

def input_domain
  @input_domain
end

#input_emailObject

Returns the value of attribute input_email.



27
28
29
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 27

def input_email
  @input_email
end

#input_labelObject

Compact human-readable identifier for the original request input.



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

def input_label
  @input_label
end

#input_nameObject

Returns the value of attribute input_name.



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

def input_name
  @input_name
end

#is_aliasObject

Returns the value of attribute is_alias.



49
50
51
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 49

def is_alias
  @is_alias
end

#is_catchallObject

Returns the value of attribute is_catchall.



51
52
53
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 51

def is_catchall
  @is_catchall
end

#metadataObject

Small transport and outcome metadata associated with the request.



47
48
49
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 47

def 
  @metadata
end

#mx_hostsObject

Returns the value of attribute mx_hosts.



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

def mx_hosts
  @mx_hosts
end

#outcomeObject

Returns the value of attribute outcome.



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

def outcome
  @outcome
end

#providerObject

Returns the value of attribute provider.



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

def provider
  @provider
end

#request_idObject

Returns the value of attribute request_id.



53
54
55
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 53

def request_id
  @request_id
end

#request_typeObject

Returns the value of attribute request_type.



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

def request_type
  @request_type
end

#resolved_addressObject

Returns the value of attribute resolved_address.



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

def resolved_address
  @resolved_address
end

#stateObject

Returns the value of attribute state.



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

def state
  @state
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



104
105
106
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 104

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



109
110
111
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 109

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 80

def self.attribute_map
  {
    :'id' => :'id',
    :'request_type' => :'request_type',
    :'input_name' => :'input_name',
    :'input_domain' => :'input_domain',
    :'input_email' => :'input_email',
    :'input_label' => :'input_label',
    :'state' => :'state',
    :'outcome' => :'outcome',
    :'resolved_address' => :'resolved_address',
    :'duration_ms' => :'duration_ms',
    :'provider' => :'provider',
    :'identity_providers' => :'identity_providers',
    :'mx_hosts' => :'mx_hosts',
    :'metadata' => :'metadata',
    :'is_alias' => :'is_alias',
    :'is_catchall' => :'is_catchall',
    :'request_id' => :'request_id',
    :'created_at' => :'created_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



412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 412

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



138
139
140
141
142
143
144
145
146
147
148
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 138

def self.openapi_nullable
  Set.new([
    :'input_name',
    :'input_domain',
    :'input_email',
    :'resolved_address',
    :'duration_ms',
    :'provider',
    :'request_id',
  ])
end

.openapi_typesObject

Attribute type mapping.



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 114

def self.openapi_types
  {
    :'id' => :'String',
    :'request_type' => :'String',
    :'input_name' => :'String',
    :'input_domain' => :'String',
    :'input_email' => :'String',
    :'input_label' => :'String',
    :'state' => :'String',
    :'outcome' => :'String',
    :'resolved_address' => :'String',
    :'duration_ms' => :'Integer',
    :'provider' => :'String',
    :'identity_providers' => :'Array<Hash<String, Object>>',
    :'mx_hosts' => :'Array<String>',
    :'metadata' => :'Hash<String, Object>',
    :'is_alias' => :'Boolean',
    :'is_catchall' => :'Boolean',
    :'request_id' => :'String',
    :'created_at' => :'Time'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 374

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      request_type == o.request_type &&
      input_name == o.input_name &&
      input_domain == o.input_domain &&
      input_email == o.input_email &&
      input_label == o.input_label &&
      state == o.state &&
      outcome == o.outcome &&
      resolved_address == o.resolved_address &&
      duration_ms == o.duration_ms &&
      provider == o.provider &&
      identity_providers == o.identity_providers &&
      mx_hosts == o.mx_hosts &&
       == o. &&
      is_alias == o.is_alias &&
      is_catchall == o.is_catchall &&
      request_id == o.request_id &&
      created_at == o.created_at
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


399
400
401
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 399

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



405
406
407
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 405

def hash
  [id, request_type, input_name, input_domain, input_email, input_label, state, outcome, resolved_address, duration_ms, provider, identity_providers, mx_hosts, , is_alias, is_catchall, request_id, created_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



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

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 @request_type.nil?
    invalid_properties.push('invalid value for "request_type", request_type cannot be nil.')
  end

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

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

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

  if @created_at.nil?
    invalid_properties.push('invalid value for "created_at", created_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



434
435
436
437
438
439
440
441
442
443
444
445
446
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 434

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



295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/relentless_identity/models/client_request_history_item.rb', line 295

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @id.nil?
  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_label.nil?
  return false if @state.nil?
  state_validator = EnumAttributeValidator.new('String', ["deliverable", "undeliverable"])
  return false unless state_validator.valid?(@state)
  return false if @outcome.nil?
  outcome_validator = EnumAttributeValidator.new('String', ["found", "not_found", "error"])
  return false unless outcome_validator.valid?(@outcome)
  return false if @created_at.nil?
  true
end