Class: Hubspot::Cms::Domains::DomainCdnConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DomainCdnConfig

Initializes the object

Parameters:

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

    Model attributes in the form of hash



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
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
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 129

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#alternate_origin_hostnameObject

Returns the value of attribute alternate_origin_hostname.



49
50
51
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 49

def alternate_origin_hostname
  @alternate_origin_hostname
end

#cdn_group_idObject

Returns the value of attribute cdn_group_id.



33
34
35
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 33

def cdn_group_id
  @cdn_group_id
end

#cdn_idObject

Returns the value of attribute cdn_id.



31
32
33
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 31

def cdn_id
  @cdn_id
end

#cert_expiration_dateObject

Returns the value of attribute cert_expiration_date.



29
30
31
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 29

def cert_expiration_date
  @cert_expiration_date
end

#cert_idObject

Returns the value of attribute cert_id.



27
28
29
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 27

def cert_id
  @cert_id
end

#cnameObject

Returns the value of attribute cname.



43
44
45
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 43

def cname
  @cname
end

#cname_targetObject

Returns the value of attribute cname_target.



45
46
47
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 45

def cname_target
  @cname_target
end

#createdObject

Returns the value of attribute created.



21
22
23
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 21

def created
  @created
end

#domain_idObject

Returns the value of attribute domain_id.



25
26
27
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 25

def domain_id
  @domain_id
end

#http_bodyObject

Returns the value of attribute http_body.



39
40
41
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 39

def http_body
  @http_body
end

#http_url_pathObject

Returns the value of attribute http_url_path.



41
42
43
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 41

def http_url_path
  @http_url_path
end

#idObject

Returns the value of attribute id.



51
52
53
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 51

def id
  @id
end

#minimum_tls_versionObject

Returns the value of attribute minimum_tls_version.



47
48
49
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 47

def minimum_tls_version
  @minimum_tls_version
end

#portal_idObject

Returns the value of attribute portal_id.



19
20
21
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 19

def portal_id
  @portal_id
end

#ssl_statusObject

Returns the value of attribute ssl_status.



35
36
37
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 35

def ssl_status
  @ssl_status
end

#updatedObject

Returns the value of attribute updated.



23
24
25
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 23

def updated
  @updated
end

#validation_methodObject

Returns the value of attribute validation_method.



37
38
39
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 37

def validation_method
  @validation_method
end

Class Method Details

.attribute_mapObject

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



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 76

def self.attribute_map
  {
    :'portal_id' => :'portalId',
    :'created' => :'created',
    :'updated' => :'updated',
    :'domain_id' => :'domainId',
    :'cert_id' => :'certId',
    :'cert_expiration_date' => :'certExpirationDate',
    :'cdn_id' => :'cdnId',
    :'cdn_group_id' => :'cdnGroupId',
    :'ssl_status' => :'sslStatus',
    :'validation_method' => :'validationMethod',
    :'http_body' => :'httpBody',
    :'http_url_path' => :'httpUrlPath',
    :'cname' => :'cname',
    :'cname_target' => :'cnameTarget',
    :'minimum_tls_version' => :'minimumTlsVersion',
    :'alternate_origin_hostname' => :'alternateOriginHostname',
    :'id' => :'id'
  }
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



384
385
386
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 384

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

.openapi_nullableObject

List of attributes with nullable: true



122
123
124
125
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 122

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

.openapi_typesObject

Attribute type mapping.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 99

def self.openapi_types
  {
    :'portal_id' => :'Integer',
    :'created' => :'Integer',
    :'updated' => :'Integer',
    :'domain_id' => :'Integer',
    :'cert_id' => :'Integer',
    :'cert_expiration_date' => :'Integer',
    :'cdn_id' => :'String',
    :'cdn_group_id' => :'String',
    :'ssl_status' => :'String',
    :'validation_method' => :'String',
    :'http_body' => :'String',
    :'http_url_path' => :'String',
    :'cname' => :'String',
    :'cname_target' => :'String',
    :'minimum_tls_version' => :'String',
    :'alternate_origin_hostname' => :'String',
    :'id' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 347

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      portal_id == o.portal_id &&
      created == o.created &&
      updated == o.updated &&
      domain_id == o.domain_id &&
      cert_id == o.cert_id &&
      cert_expiration_date == o.cert_expiration_date &&
      cdn_id == o.cdn_id &&
      cdn_group_id == o.cdn_group_id &&
      ssl_status == o.ssl_status &&
      validation_method == o.validation_method &&
      http_body == o.http_body &&
      http_url_path == o.http_url_path &&
      cname == o.cname &&
      cname_target == o.cname_target &&
      minimum_tls_version == o.minimum_tls_version &&
      alternate_origin_hostname == o.alternate_origin_hostname &&
      id == o.id
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



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
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 412

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
    Hubspot::Cms::Domains.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



481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 481

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



391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 391

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


371
372
373
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 371

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



377
378
379
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 377

def hash
  [portal_id, created, updated, domain_id, cert_id, cert_expiration_date, cdn_id, cdn_group_id, ssl_status, validation_method, http_body, http_url_path, cname, cname_target, minimum_tls_version, alternate_origin_hostname, id].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
276
277
278
279
280
281
282
283
284
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 213

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



457
458
459
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 457

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



463
464
465
466
467
468
469
470
471
472
473
474
475
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 463

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



451
452
453
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 451

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



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
# File 'lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb', line 288

def valid?
  return false if @portal_id.nil?
  return false if @created.nil?
  return false if @updated.nil?
  return false if @domain_id.nil?
  return false if @cert_id.nil?
  return false if @cert_expiration_date.nil?
  return false if @cdn_id.nil?
  return false if @cdn_group_id.nil?
  return false if @ssl_status.nil?
  ssl_status_validator = EnumAttributeValidator.new('String', ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"])
  return false unless ssl_status_validator.valid?(@ssl_status)
  return false if @validation_method.nil?
  validation_method_validator = EnumAttributeValidator.new('String', ["0", "1", "2"])
  return false unless validation_method_validator.valid?(@validation_method)
  return false if @http_body.nil?
  return false if @http_url_path.nil?
  return false if @cname.nil?
  return false if @cname_target.nil?
  return false if @minimum_tls_version.nil?
  minimum_tls_version_validator = EnumAttributeValidator.new('String', ["1.0", "1.1", "1.2", "1.3", "none", "null"])
  return false unless minimum_tls_version_validator.valid?(@minimum_tls_version)
  return false if @alternate_origin_hostname.nil?
  return false if @id.nil?
  true
end