Class: Sendmux::Management::Generated::ProviderItem

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/sendmux_management_generated/models/provider_item.rb

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 217

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#allowed_actionsObject

Returns the value of attribute allowed_actions.



18
19
20
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 18

def allowed_actions
  @allowed_actions
end

#created_atObject

ISO 8601 creation timestamp



21
22
23
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 21

def created_at
  @created_at
end

#from_emailObject

Default From email address.



24
25
26
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 24

def from_email
  @from_email
end

#from_nameObject

Default From display name.



27
28
29
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 27

def from_name
  @from_name
end

#has_refresh_tokenObject

Whether an OAuth account has an active connection token.



30
31
32
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 30

def has_refresh_token
  @has_refresh_token
end

#has_smtp_passwordObject

Whether a custom SMTP password is stored.



33
34
35
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 33

def has_smtp_password
  @has_smtp_password
end

#idObject

Sending account public ID



36
37
38
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 36

def id
  @id
end

#is_activeObject

Whether this account is enabled for sending.



39
40
41
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 39

def is_active
  @is_active
end

#is_editableObject

False when the account is platform-managed.



42
43
44
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 42

def is_editable
  @is_editable
end

#is_sharedObject

True for the team’s shared Amazon SES account.



45
46
47
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 45

def is_shared
  @is_shared
end

#last_tested_atObject

Last connection test timestamp.



48
49
50
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 48

def last_tested_at
  @last_tested_at
end

#last_used_atObject

Last send timestamp.



51
52
53
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 51

def last_used_at
  @last_used_at
end

#nameObject

Display name



54
55
56
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 54

def name
  @name
end

#oauth_emailObject

Connected account email for OAuth accounts.



57
58
59
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 57

def oauth_email
  @oauth_email
end

#percentageObject

Routing weight percentage.



60
61
62
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 60

def percentage
  @percentage
end

#quotasObject

Returns the value of attribute quotas.



62
63
64
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 62

def quotas
  @quotas
end

#reply_to_emailObject

Default Reply-To email address.



65
66
67
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 65

def reply_to_email
  @reply_to_email
end

#reply_to_nameObject

Default Reply-To display name.



68
69
70
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 68

def reply_to_name
  @reply_to_name
end

#smtp_hostObject

SMTP host for custom SMTP accounts.



71
72
73
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 71

def smtp_host
  @smtp_host
end

#smtp_portObject

SMTP port for custom SMTP accounts.



74
75
76
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 74

def smtp_port
  @smtp_port
end

#smtp_protocolObject

SMTP security mode.



77
78
79
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 77

def smtp_protocol
  @smtp_protocol
end

#smtp_usernameObject

SMTP username for custom SMTP accounts.



80
81
82
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 80

def smtp_username
  @smtp_username
end

#statusObject

Current sending account status.



83
84
85
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 83

def status
  @status
end

#status_reasonObject

Public-safe reason for the current status.



86
87
88
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 86

def status_reason
  @status_reason
end

#tracking_domainObject

Custom tracking hostname.



89
90
91
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 89

def tracking_domain
  @tracking_domain
end

#typeObject

Sending account type. ‘amazon_ses` is the shared managed account.



92
93
94
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 92

def type
  @type
end

#updated_atObject

ISO 8601 last update timestamp



95
96
97
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 95

def updated_at
  @updated_at
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



153
154
155
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 153

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



158
159
160
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 158

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



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
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 120

def self.attribute_map
  {
    :'allowed_actions' => :'allowed_actions',
    :'created_at' => :'created_at',
    :'from_email' => :'from_email',
    :'from_name' => :'from_name',
    :'has_refresh_token' => :'has_refresh_token',
    :'has_smtp_password' => :'has_smtp_password',
    :'id' => :'id',
    :'is_active' => :'is_active',
    :'is_editable' => :'is_editable',
    :'is_shared' => :'is_shared',
    :'last_tested_at' => :'last_tested_at',
    :'last_used_at' => :'last_used_at',
    :'name' => :'name',
    :'oauth_email' => :'oauth_email',
    :'percentage' => :'percentage',
    :'quotas' => :'quotas',
    :'reply_to_email' => :'reply_to_email',
    :'reply_to_name' => :'reply_to_name',
    :'smtp_host' => :'smtp_host',
    :'smtp_port' => :'smtp_port',
    :'smtp_protocol' => :'smtp_protocol',
    :'smtp_username' => :'smtp_username',
    :'status' => :'status',
    :'status_reason' => :'status_reason',
    :'tracking_domain' => :'tracking_domain',
    :'type' => :'type',
    :'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



657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 657

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



196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 196

def self.openapi_nullable
  Set.new([
    :'from_email',
    :'from_name',
    :'last_tested_at',
    :'last_used_at',
    :'oauth_email',
    :'percentage',
    :'reply_to_email',
    :'reply_to_name',
    :'smtp_host',
    :'smtp_port',
    :'smtp_protocol',
    :'smtp_username',
    :'status_reason',
    :'tracking_domain',
  ])
end

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 163

def self.openapi_types
  {
    :'allowed_actions' => :'ProviderAllowedActions',
    :'created_at' => :'String',
    :'from_email' => :'String',
    :'from_name' => :'String',
    :'has_refresh_token' => :'Boolean',
    :'has_smtp_password' => :'Boolean',
    :'id' => :'String',
    :'is_active' => :'Boolean',
    :'is_editable' => :'Boolean',
    :'is_shared' => :'Boolean',
    :'last_tested_at' => :'String',
    :'last_used_at' => :'String',
    :'name' => :'String',
    :'oauth_email' => :'String',
    :'percentage' => :'Integer',
    :'quotas' => :'ProviderQuotas',
    :'reply_to_email' => :'String',
    :'reply_to_name' => :'String',
    :'smtp_host' => :'String',
    :'smtp_port' => :'Integer',
    :'smtp_protocol' => :'String',
    :'smtp_username' => :'String',
    :'status' => :'String',
    :'status_reason' => :'String',
    :'tracking_domain' => :'String',
    :'type' => :'String',
    :'updated_at' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 610

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      allowed_actions == o.allowed_actions &&
      created_at == o.created_at &&
      from_email == o.from_email &&
      from_name == o.from_name &&
      has_refresh_token == o.has_refresh_token &&
      has_smtp_password == o.has_smtp_password &&
      id == o.id &&
      is_active == o.is_active &&
      is_editable == o.is_editable &&
      is_shared == o.is_shared &&
      last_tested_at == o.last_tested_at &&
      last_used_at == o.last_used_at &&
      name == o.name &&
      oauth_email == o.oauth_email &&
      percentage == o.percentage &&
      quotas == o.quotas &&
      reply_to_email == o.reply_to_email &&
      reply_to_name == o.reply_to_name &&
      smtp_host == o.smtp_host &&
      smtp_port == o.smtp_port &&
      smtp_protocol == o.smtp_protocol &&
      smtp_username == o.smtp_username &&
      status == o.status &&
      status_reason == o.status_reason &&
      tracking_domain == o.tracking_domain &&
      type == o.type &&
      updated_at == o.updated_at
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


644
645
646
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 644

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



650
651
652
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 650

def hash
  [allowed_actions, created_at, from_email, from_name, has_refresh_token, has_smtp_password, id, is_active, is_editable, is_shared, last_tested_at, last_used_at, name, oauth_email, percentage, quotas, reply_to_email, reply_to_name, smtp_host, smtp_port, smtp_protocol, smtp_username, status, status_reason, tracking_domain, type, 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



396
397
398
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
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 396

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

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

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

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

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

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

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

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

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

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

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

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



679
680
681
682
683
684
685
686
687
688
689
690
691
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 679

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



456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
# File 'lib/sendmux_management_generated/models/provider_item.rb', line 456

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @allowed_actions.nil?
  return false if @created_at.nil?
  return false if @has_refresh_token.nil?
  return false if @has_smtp_password.nil?
  return false if @id.nil?
  return false if @is_active.nil?
  return false if @is_editable.nil?
  return false if @is_shared.nil?
  return false if @name.nil?
  return false if @quotas.nil?
  return false if @status.nil?
  status_validator = EnumAttributeValidator.new('String', ["active", "inactive", "error", "pending", "unknown_default_open_api"])
  return false unless status_validator.valid?(@status)
  return false if @type.nil?
  type_validator = EnumAttributeValidator.new('String', ["smtp", "gmail_api", "outlook_api", "amazon_ses", "unknown_default_open_api"])
  return false unless type_validator.valid?(@type)
  return false if @updated_at.nil?
  true
end