Class: MailSlurpClient::DeliverabilityTestDto

Inherits:
Object
  • Object
show all
Defined in:
lib/mailslurp_client/models/deliverability_test_dto.rb

Overview

Deliverability test configuration and progress summary

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DeliverabilityTestDto

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 165

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

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

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

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

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

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

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

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

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

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

  if attributes.key?(:'start_at')
    self.start_at = attributes[:'start_at']
  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?(:'max_duration_seconds')
    self.max_duration_seconds = attributes[:'max_duration_seconds']
  end

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#completed_atObject

Returns the value of attribute completed_at.



38
39
40
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 38

def completed_at
  @completed_at
end

#completion_percentageObject

Returns the value of attribute completion_percentage.



56
57
58
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 56

def completion_percentage
  @completion_percentage
end

#created_atObject

Returns the value of attribute created_at.



62
63
64
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 62

def created_at
  @created_at
end

#descriptionObject

Returns the value of attribute description.



22
23
24
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 22

def description
  @description
end

#expectationsObject

Returns the value of attribute expectations.



30
31
32
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 30

def expectations
  @expectations
end

#failure_reasonObject

Returns the value of attribute failure_reason.



60
61
62
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 60

def failure_reason
  @failure_reason
end

#idObject

Returns the value of attribute id.



18
19
20
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 18

def id
  @id
end

#last_evaluated_atObject

Returns the value of attribute last_evaluated_at.



48
49
50
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 48

def last_evaluated_at
  @last_evaluated_at
end

#matched_entitiesObject

Returns the value of attribute matched_entities.



52
53
54
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 52

def matched_entities
  @matched_entities
end

#max_duration_secondsObject

Returns the value of attribute max_duration_seconds.



40
41
42
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 40

def max_duration_seconds
  @max_duration_seconds
end

#nameObject

Returns the value of attribute name.



20
21
22
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 20

def name
  @name
end

#scopeObject

Returns the value of attribute scope.



24
25
26
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 24

def scope
  @scope
end

#selected_entity_countObject

Returns the value of attribute selected_entity_count.



28
29
30
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 28

def selected_entity_count
  @selected_entity_count
end

#selectorObject

Returns the value of attribute selector.



26
27
28
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 26

def selector
  @selector
end

#start_atObject

Returns the value of attribute start_at.



34
35
36
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 34

def start_at
  @start_at
end

#started_atObject

Returns the value of attribute started_at.



36
37
38
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 36

def started_at
  @started_at
end

#statusObject

Returns the value of attribute status.



32
33
34
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 32

def status
  @status
end

#success_threshold_percentObject

Returns the value of attribute success_threshold_percent.



42
43
44
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 42

def success_threshold_percent
  @success_threshold_percent
end

#threshold_metObject

Returns the value of attribute threshold_met.



46
47
48
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 46

def threshold_met
  @threshold_met
end

#threshold_statusObject

Returns the value of attribute threshold_status.



44
45
46
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 44

def threshold_status
  @threshold_status
end

#timed_outObject

Returns the value of attribute timed_out.



58
59
60
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 58

def timed_out
  @timed_out
end

#total_entitiesObject

Returns the value of attribute total_entities.



50
51
52
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 50

def total_entities
  @total_entities
end

#unmatched_entitiesObject

Returns the value of attribute unmatched_entities.



54
55
56
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 54

def unmatched_entities
  @unmatched_entities
end

#updated_atObject

Returns the value of attribute updated_at.



64
65
66
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 64

def updated_at
  @updated_at
end

Class Method Details

.attribute_mapObject

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



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 89

def self.attribute_map
  {
    :'id' => :'id',
    :'name' => :'name',
    :'description' => :'description',
    :'scope' => :'scope',
    :'selector' => :'selector',
    :'selected_entity_count' => :'selectedEntityCount',
    :'expectations' => :'expectations',
    :'status' => :'status',
    :'start_at' => :'startAt',
    :'started_at' => :'startedAt',
    :'completed_at' => :'completedAt',
    :'max_duration_seconds' => :'maxDurationSeconds',
    :'success_threshold_percent' => :'successThresholdPercent',
    :'threshold_status' => :'thresholdStatus',
    :'threshold_met' => :'thresholdMet',
    :'last_evaluated_at' => :'lastEvaluatedAt',
    :'total_entities' => :'totalEntities',
    :'matched_entities' => :'matchedEntities',
    :'unmatched_entities' => :'unmatchedEntities',
    :'completion_percentage' => :'completionPercentage',
    :'timed_out' => :'timedOut',
    :'failure_reason' => :'failureReason',
    :'created_at' => :'createdAt',
    :'updated_at' => :'updatedAt'
  }
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



447
448
449
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 447

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 149

def self.openapi_nullable
  Set.new([
    :'name',
    :'description',
    :'started_at',
    :'completed_at',
    :'max_duration_seconds',
    :'success_threshold_percent',
    :'threshold_met',
    :'last_evaluated_at',
    :'failure_reason',
  ])
end

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 119

def self.openapi_types
  {
    :'id' => :'String',
    :'name' => :'String',
    :'description' => :'String',
    :'scope' => :'String',
    :'selector' => :'DeliverabilitySelectorOptions',
    :'selected_entity_count' => :'Integer',
    :'expectations' => :'Array<DeliverabilityExpectation>',
    :'status' => :'String',
    :'start_at' => :'DateTime',
    :'started_at' => :'DateTime',
    :'completed_at' => :'DateTime',
    :'max_duration_seconds' => :'Integer',
    :'success_threshold_percent' => :'Float',
    :'threshold_status' => :'String',
    :'threshold_met' => :'Boolean',
    :'last_evaluated_at' => :'DateTime',
    :'total_entities' => :'Integer',
    :'matched_entities' => :'Integer',
    :'unmatched_entities' => :'Integer',
    :'completion_percentage' => :'Float',
    :'timed_out' => :'Boolean',
    :'failure_reason' => :'String',
    :'created_at' => :'DateTime',
    :'updated_at' => :'DateTime'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
429
430
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 403

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      name == o.name &&
      description == o.description &&
      scope == o.scope &&
      selector == o.selector &&
      selected_entity_count == o.selected_entity_count &&
      expectations == o.expectations &&
      status == o.status &&
      start_at == o.start_at &&
      started_at == o.started_at &&
      completed_at == o.completed_at &&
      max_duration_seconds == o.max_duration_seconds &&
      success_threshold_percent == o.success_threshold_percent &&
      threshold_status == o.threshold_status &&
      threshold_met == o.threshold_met &&
      last_evaluated_at == o.last_evaluated_at &&
      total_entities == o.total_entities &&
      matched_entities == o.matched_entities &&
      unmatched_entities == o.unmatched_entities &&
      completion_percentage == o.completion_percentage &&
      timed_out == o.timed_out &&
      failure_reason == o.failure_reason &&
      created_at == o.created_at &&
      updated_at == o.updated_at
end

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



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
507
508
509
510
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 475

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.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
    MailSlurpClient.const_get(type).build_from_hash(value)
  end
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



544
545
546
547
548
549
550
551
552
553
554
555
556
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 544

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

#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



454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 454

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if 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[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(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?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


434
435
436
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 434

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



440
441
442
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 440

def hash
  [id, name, description, scope, selector, selected_entity_count, expectations, status, start_at, started_at, completed_at, max_duration_seconds, success_threshold_percent, threshold_status, threshold_met, last_evaluated_at, total_entities, matched_entities, unmatched_entities, completion_percentage, timed_out, failure_reason, 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



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
306
307
308
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
334
335
336
337
338
339
340
341
342
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 279

def list_invalid_properties
  invalid_properties = Array.new
  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

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

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

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

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

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

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

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

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

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

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

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

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

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



520
521
522
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 520

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



526
527
528
529
530
531
532
533
534
535
536
537
538
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 526

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



514
515
516
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 514

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



346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/mailslurp_client/models/deliverability_test_dto.rb', line 346

def valid?
  return false if @id.nil?
  return false if @scope.nil?
  scope_validator = EnumAttributeValidator.new('String', ["INBOX", "PHONE"])
  return false unless scope_validator.valid?(@scope)
  return false if @selector.nil?
  return false if @selected_entity_count.nil?
  return false if @expectations.nil?
  return false if @status.nil?
  status_validator = EnumAttributeValidator.new('String', ["CREATED", "SCHEDULED", "RUNNING", "PAUSED", "STOPPED", "COMPLETE", "FAILED"])
  return false unless status_validator.valid?(@status)
  return false if @start_at.nil?
  return false if @threshold_status.nil?
  threshold_status_validator = EnumAttributeValidator.new('String', ["NOT_CONFIGURED", "PASSING", "FAILING"])
  return false unless threshold_status_validator.valid?(@threshold_status)
  return false if @total_entities.nil?
  return false if @matched_entities.nil?
  return false if @unmatched_entities.nil?
  return false if @completion_percentage.nil?
  return false if @timed_out.nil?
  return false if @created_at.nil?
  return false if @updated_at.nil?
  true
end