class Hubspot::Cms::Domains::DomainCdnConfig

Attributes

alternate_origin_hostname[RW]
cdn_group_id[RW]
cdn_id[RW]
cert_expiration_date[RW]
cert_id[RW]
cname[RW]
cname_target[RW]
created[RW]
domain_id[RW]
http_body[RW]
http_url_path[RW]
id[RW]
minimum_tls_version[RW]
portal_id[RW]
ssl_status[RW]
updated[RW]
validation_method[RW]

Public Class Methods

attribute_map() click to toggle source

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

# 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) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# 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
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# 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
openapi_nullable() click to toggle source

List of attributes with nullable: true

# File lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb, line 122
def self.openapi_nullable
  Set.new([
  ])
end
openapi_types() click to toggle source

Attribute type mapping.

# 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

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# 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) click to toggle source

Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data

# 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) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# 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) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# 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) click to toggle source

@see the `==` method @param [Object] Object to be compared

# File lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb, line 371
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Integer] Hash code

# 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_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# 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
minimum_tls_version=(minimum_tls_version) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] minimum_tls_version Object to be assigned

# File lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb, line 337
def minimum_tls_version=(minimum_tls_version)
  validator = EnumAttributeValidator.new('String', ["1.0", "1.1", "1.2", "1.3", "none", "null"])
  unless validator.valid?(minimum_tls_version)
    fail ArgumentError, "invalid value for \"minimum_tls_version\", must be one of #{validator.allowable_values}."
  end
  @minimum_tls_version = minimum_tls_version
end
ssl_status=(ssl_status) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] ssl_status Object to be assigned

# File lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb, line 317
def ssl_status=(ssl_status)
  validator = EnumAttributeValidator.new('String', ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"])
  unless validator.valid?(ssl_status)
    fail ArgumentError, "invalid value for \"ssl_status\", must be one of #{validator.allowable_values}."
  end
  @ssl_status = ssl_status
end
to_body() click to toggle source

to_body is an alias to to_hash (backward compatibility) @return [Hash] Returns the object in the form of hash

# File lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb, line 457
def to_body
  to_hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# 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_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb, line 451
def to_s
  to_hash.to_s
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# 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
validation_method=(validation_method) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] validation_method Object to be assigned

# File lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb, line 327
def validation_method=(validation_method)
  validator = EnumAttributeValidator.new('String', ["0", "1", "2"])
  unless validator.valid?(validation_method)
    fail ArgumentError, "invalid value for \"validation_method\", must be one of #{validator.allowable_values}."
  end
  @validation_method = validation_method
end