Class: Sendpost::IP

Inherits:
Object
  • Object
show all
Defined in:
lib/sendpost_ruby_sdk/models/ip.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ IP

Initializes the object

Parameters:

  • (defaults to: {})

    Model attributes in the form of hash



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#aol_settingsObject

Configuration for AOL delivery settings in JSON format



39
40
41
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 39

def aol_settings
  @aol_settings
end

#att_settingsObject

Configuration for AT&T delivery settings in JSON format



69
70
71
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 69

def att_settings
  @att_settings
end

#auto_warmup_planObject

The auto-warmup plan associated with the IP. Can be null if no warmup plan is assigned.



84
85
86
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 84

def auto_warmup_plan
  @auto_warmup_plan
end

#comcast_settingsObject

Configuration for Comcast delivery settings in JSON format



45
46
47
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 45

def comcast_settings
  @comcast_settings
end

#createdObject

The timestamp (UNIX epoch) when the IP was created



72
73
74
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 72

def created
  @created
end

#default_settingsObject

Default delivery settings in JSON format



66
67
68
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 66

def default_settings
  @default_settings
end

#gmail_settingsObject

Configuration for Gmail delivery settings in JSON format



33
34
35
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 33

def gmail_settings
  @gmail_settings
end

#gmx_settingsObject

Configuration for GMX delivery settings in JSON format



51
52
53
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 51

def gmx_settings
  @gmx_settings
end

#icloud_settingsObject

Configuration for iCloud delivery settings in JSON format



57
58
59
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 57

def icloud_settings
  @icloud_settings
end

#idObject

Unique ID for the IP



19
20
21
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 19

def id
  @id
end

#infra_classificationObject

Classification of the infrastructure



75
76
77
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 75

def infra_classification
  @infra_classification
end

#infra_monitorObject

Indicates whether infrastructure monitoring is enabled



78
79
80
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 78

def infra_monitor
  @infra_monitor
end

#mailru_settingsObject

Configuration for Mail.ru delivery settings in JSON format



54
55
56
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 54

def mailru_settings
  @mailru_settings
end

#microsoft_settingsObject

Configuration for Microsoft delivery settings in JSON format



42
43
44
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 42

def microsoft_settings
  @microsoft_settings
end

#public_ipObject

The public IP address associated with the resource



22
23
24
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 22

def public_ip
  @public_ip
end

#qq_settingsObject

Configuration for QQ delivery settings in JSON format



63
64
65
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 63

def qq_settings
  @qq_settings
end

#reverse_dns_hostnameObject

The reverse DNS hostname for the IP



27
28
29
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 27

def reverse_dns_hostname
  @reverse_dns_hostname
end

#stateObject

The state of the IP



81
82
83
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 81

def state
  @state
end

#system_domainObject

Returns the value of attribute system_domain.



24
25
26
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 24

def system_domain
  @system_domain
end

#typeObject

Type of the IP



30
31
32
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 30

def type
  @type
end

#yahoo_settingsObject

Configuration for Yahoo delivery settings in JSON format



36
37
38
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 36

def yahoo_settings
  @yahoo_settings
end

#yandex_settingsObject

Configuration for Yandex delivery settings in JSON format



48
49
50
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 48

def yandex_settings
  @yandex_settings
end

#zoho_settingsObject

Configuration for Zoho delivery settings in JSON format



60
61
62
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 60

def zoho_settings
  @zoho_settings
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • type Data type

  • value Value to be deserialized

Returns:

  • Deserialized data



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
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 404

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 = Sendpost.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



116
117
118
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 116

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



121
122
123
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 121

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



87
88
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
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 87

def self.attribute_map
  {
    :'id' => :'id',
    :'public_ip' => :'publicIP',
    :'system_domain' => :'systemDomain',
    :'reverse_dns_hostname' => :'reverseDNSHostname',
    :'type' => :'type',
    :'gmail_settings' => :'gmailSettings',
    :'yahoo_settings' => :'yahooSettings',
    :'aol_settings' => :'aolSettings',
    :'microsoft_settings' => :'microsoftSettings',
    :'comcast_settings' => :'comcastSettings',
    :'yandex_settings' => :'yandexSettings',
    :'gmx_settings' => :'gmxSettings',
    :'mailru_settings' => :'mailruSettings',
    :'icloud_settings' => :'icloudSettings',
    :'zoho_settings' => :'zohoSettings',
    :'qq_settings' => :'qqSettings',
    :'default_settings' => :'defaultSettings',
    :'att_settings' => :'attSettings',
    :'created' => :'created',
    :'infra_classification' => :'infraClassification',
    :'infra_monitor' => :'infraMonitor',
    :'state' => :'state',
    :'auto_warmup_plan' => :'autoWarmupPlan'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • Model attributes in the form of hash

Returns:

  • Returns the model itself



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

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



155
156
157
158
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 155

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

.openapi_typesObject

Attribute type mapping.



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
151
152
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 126

def self.openapi_types
  {
    :'id' => :'Integer',
    :'public_ip' => :'String',
    :'system_domain' => :'Domain',
    :'reverse_dns_hostname' => :'String',
    :'type' => :'Integer',
    :'gmail_settings' => :'String',
    :'yahoo_settings' => :'String',
    :'aol_settings' => :'String',
    :'microsoft_settings' => :'String',
    :'comcast_settings' => :'String',
    :'yandex_settings' => :'String',
    :'gmx_settings' => :'String',
    :'mailru_settings' => :'String',
    :'icloud_settings' => :'String',
    :'zoho_settings' => :'String',
    :'qq_settings' => :'String',
    :'default_settings' => :'String',
    :'att_settings' => :'String',
    :'created' => :'Integer',
    :'infra_classification' => :'String',
    :'infra_monitor' => :'Boolean',
    :'state' => :'Integer',
    :'auto_warmup_plan' => :'AutoWarmupPlan'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • to be compared



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
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 337

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      public_ip == o.public_ip &&
      system_domain == o.system_domain &&
      reverse_dns_hostname == o.reverse_dns_hostname &&
      type == o.type &&
      gmail_settings == o.gmail_settings &&
      yahoo_settings == o.yahoo_settings &&
      aol_settings == o.aol_settings &&
      microsoft_settings == o.microsoft_settings &&
      comcast_settings == o.comcast_settings &&
      yandex_settings == o.yandex_settings &&
      gmx_settings == o.gmx_settings &&
      mailru_settings == o.mailru_settings &&
      icloud_settings == o.icloud_settings &&
      zoho_settings == o.zoho_settings &&
      qq_settings == o.qq_settings &&
      default_settings == o.default_settings &&
      att_settings == o.att_settings &&
      created == o.created &&
      infra_classification == o.infra_classification &&
      infra_monitor == o.infra_monitor &&
      state == o.state &&
      auto_warmup_plan == o.auto_warmup_plan
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:

  • Any valid value

Returns:

  • Returns the value in the form of hash



475
476
477
478
479
480
481
482
483
484
485
486
487
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 475

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

See Also:

  • `==` method

Parameters:

  • to be compared

Returns:



367
368
369
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 367

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • Hash code



373
374
375
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 373

def hash
  [id, public_ip, system_domain, reverse_dns_hostname, type, gmail_settings, yahoo_settings, aol_settings, microsoft_settings, comcast_settings, yandex_settings, gmx_settings, mailru_settings, icloud_settings, zoho_settings, qq_settings, default_settings, att_settings, created, infra_classification, infra_monitor, state, auto_warmup_plan].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 277

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

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

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • Returns the object in the form of hash



451
452
453
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 451

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • Returns the object in the form of hash



457
458
459
460
461
462
463
464
465
466
467
468
469
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 457

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 presentation of the object



445
446
447
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 445

def to_s
  to_hash.to_s
end

#valid?Boolean

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

Returns:

  • true if the model is valid



297
298
299
300
301
302
303
# File 'lib/sendpost_ruby_sdk/models/ip.rb', line 297

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @id.nil?
  return false if @public_ip.nil?
  return false if @created.nil?
  true
end