class VSphereAutomation::VCenter::VcenterCertificateManagementVcenterTlsInfo

Attributes

authority_information_access_uri[RW]

Collection of authority information access URI.

basic_constraints[RW]

Certificate constraints path length from the critical BasicConstraints extension, (OID = 2.5.29.19).

cert[RW]

TLS certificate in PEM format.

extended_key_usage[RW]

Collection of extended keyusage that contains details for which the certificate can be used for.

issuer_dn[RW]

Issuer (issuer distinguished name) value from the certificate.

key_usage[RW]

Collection of keyusage contained in the certificate.

serial_number[RW]

SerialNumber value from the certificate.

signature_algorithm[RW]

Signature algorithm name from the certificate.

subject_alternative_name[RW]

Collection of subject alternative names.

subject_dn[RW]

Subject (subject distinguished name) value from the certificate.

thumbprint[RW]

Thumbprint value from the certificate.

valid_from[RW]

validFrom specify the start date of the certificate.

valid_to[RW]

validTo specify the end date of the certificate.

version[RW]

Version (version number) value from the certificate.

Public Class Methods

attribute_map() click to toggle source

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

# File lib/vsphere-automation-vcenter/models/vcenter_certificate_management_vcenter_tls_info.rb, line 57
def self.attribute_map
  {
    :'version' => :'version',
    :'serial_number' => :'serial_number',
    :'signature_algorithm' => :'signature_algorithm',
    :'issuer_dn' => :'issuer_dn',
    :'valid_from' => :'valid_from',
    :'valid_to' => :'valid_to',
    :'subject_dn' => :'subject_dn',
    :'thumbprint' => :'thumbprint',
    :'basic_constraints' => :'basic_constraints',
    :'key_usage' => :'key_usage',
    :'extended_key_usage' => :'extended_key_usage',
    :'subject_alternative_name' => :'subject_alternative_name',
    :'authority_information_access_uri' => :'authority_information_access_uri',
    :'cert' => :'cert'
  }
end
new(attributes = {}) click to toggle source

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

# File lib/vsphere-automation-vcenter/models/vcenter_certificate_management_vcenter_tls_info.rb, line 98
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'version')
    self.version = attributes[:'version']
  end

  if attributes.has_key?(:'serial_number')
    self.serial_number = attributes[:'serial_number']
  end

  if attributes.has_key?(:'signature_algorithm')
    self.signature_algorithm = attributes[:'signature_algorithm']
  end

  if attributes.has_key?(:'issuer_dn')
    self.issuer_dn = attributes[:'issuer_dn']
  end

  if attributes.has_key?(:'valid_from')
    self.valid_from = attributes[:'valid_from']
  end

  if attributes.has_key?(:'valid_to')
    self.valid_to = attributes[:'valid_to']
  end

  if attributes.has_key?(:'subject_dn')
    self.subject_dn = attributes[:'subject_dn']
  end

  if attributes.has_key?(:'thumbprint')
    self.thumbprint = attributes[:'thumbprint']
  end

  if attributes.has_key?(:'basic_constraints')
    self.basic_constraints = attributes[:'basic_constraints']
  end

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

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

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

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

  if attributes.has_key?(:'cert')
    self.cert = attributes[:'cert']
  end
end
openapi_types() click to toggle source

Attribute type mapping.

# File lib/vsphere-automation-vcenter/models/vcenter_certificate_management_vcenter_tls_info.rb, line 77
def self.openapi_types
  {
    :'version' => :'Integer',
    :'serial_number' => :'String',
    :'signature_algorithm' => :'String',
    :'issuer_dn' => :'String',
    :'valid_from' => :'DateTime',
    :'valid_to' => :'DateTime',
    :'subject_dn' => :'String',
    :'thumbprint' => :'String',
    :'basic_constraints' => :'Integer',
    :'key_usage' => :'Array<String>',
    :'extended_key_usage' => :'Array<String>',
    :'subject_alternative_name' => :'Array<String>',
    :'authority_information_access_uri' => :'Array<String>',
    :'cert' => :'String'
  }
end

Public Instance Methods

==(o) click to toggle source

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

# File lib/vsphere-automation-vcenter/models/vcenter_certificate_management_vcenter_tls_info.rb, line 254
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      version == o.version &&
      serial_number == o.serial_number &&
      signature_algorithm == o.signature_algorithm &&
      issuer_dn == o.issuer_dn &&
      valid_from == o.valid_from &&
      valid_to == o.valid_to &&
      subject_dn == o.subject_dn &&
      thumbprint == o.thumbprint &&
      basic_constraints == o.basic_constraints &&
      key_usage == o.key_usage &&
      extended_key_usage == o.extended_key_usage &&
      subject_alternative_name == o.subject_alternative_name &&
      authority_information_access_uri == o.authority_information_access_uri &&
      cert == o.cert
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/vsphere-automation-vcenter/models/vcenter_certificate_management_vcenter_tls_info.rb, line 309
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, :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
    temp_model = VSphereAutomation::VCenter.const_get(type).new
    temp_model.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/vsphere-automation-vcenter/models/vcenter_certificate_management_vcenter_tls_info.rb, line 375
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/vsphere-automation-vcenter/models/vcenter_certificate_management_vcenter_tls_info.rb, line 288
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 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/vsphere-automation-vcenter/models/vcenter_certificate_management_vcenter_tls_info.rb, line 275
def eql?(o)
  self == o
end
hash() click to toggle source

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

# File lib/vsphere-automation-vcenter/models/vcenter_certificate_management_vcenter_tls_info.rb, line 281
def hash
  [version, serial_number, signature_algorithm, issuer_dn, valid_from, valid_to, subject_dn, thumbprint, basic_constraints, key_usage, extended_key_usage, subject_alternative_name, authority_information_access_uri, cert].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/vsphere-automation-vcenter/models/vcenter_certificate_management_vcenter_tls_info.rb, line 171
def list_invalid_properties
  invalid_properties = Array.new
  if @version.nil?
    invalid_properties.push('invalid value for "version", version cannot be nil.')
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

  invalid_properties
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/vsphere-automation-vcenter/models/vcenter_certificate_management_vcenter_tls_info.rb, line 355
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/vsphere-automation-vcenter/models/vcenter_certificate_management_vcenter_tls_info.rb, line 361
def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    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/vsphere-automation-vcenter/models/vcenter_certificate_management_vcenter_tls_info.rb, line 349
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/vsphere-automation-vcenter/models/vcenter_certificate_management_vcenter_tls_info.rb, line 234
def valid?
  return false if @version.nil?
  return false if @serial_number.nil?
  return false if @signature_algorithm.nil?
  return false if @issuer_dn.nil?
  return false if @valid_from.nil?
  return false if @valid_to.nil?
  return false if @subject_dn.nil?
  return false if @thumbprint.nil?
  return false if @basic_constraints.nil?
  return false if @key_usage.nil?
  return false if @extended_key_usage.nil?
  return false if @subject_alternative_name.nil?
  return false if @authority_information_access_uri.nil?
  return false if @cert.nil?
  true
end