class YousignClient::CheckDocumentIdentitiesOutput

Attributes

birth_date[RW]

Birth date to check on document

birth_name[RW]

Birth name to check on document

birth_name_valid[RW]

Defines if birth name sent in the input is valid

created_at[RW]

Created date of the object

creator[RW]

Creator of the object

document_type[RW]

Type of document

expired[RW]

Defines if the document is expired

extracted_birth_date[RW]

Extracted birth date on the document

extracted_birth_name[RW]

Extracted birth name on the document

extracted_expiration_date[RW]

Extracted expiration date on the document

extracted_first_names[RW]

Extracted firstnames on the document

extracted_gender[RW]

Extracted gender on the document

extracted_issuance_date[RW]

Extracted issuance date on the document

extracted_mrz[RW]

Extracted MRZ on the document

first_name_valid[RW]

Defines if one firstname sent in the input is valid

first_names[RW]

List of firstnames to check on document

id[RW]

Id of the object

mrz_valid[RW]

Defines if MRZ sent in the input is valid

updated_at[RW]

Updated date of the object

valid[RW]

Defines if the document is valid

workspace[RW]

workspace creator of the object

Public Class Methods

attribute_map() click to toggle source

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

# File lib/yousign_client/models/check_document_identities_output.rb, line 103
def self.attribute_map
  {
    :'id' => :'id',
    :'created_at' => :'createdAt',
    :'updated_at' => :'updatedAt',
    :'first_names' => :'firstNames',
    :'birth_name' => :'birthName',
    :'birth_date' => :'birthDate',
    :'workspace' => :'workspace',
    :'creator' => :'creator',
    :'document_type' => :'documentType',
    :'extracted_first_names' => :'extractedFirstNames',
    :'extracted_birth_name' => :'extractedBirthName',
    :'extracted_birth_date' => :'extractedBirthDate',
    :'extracted_gender' => :'extractedGender',
    :'extracted_issuance_date' => :'extractedIssuanceDate',
    :'extracted_expiration_date' => :'extractedExpirationDate',
    :'extracted_mrz' => :'extractedMrz',
    :'first_name_valid' => :'firstNameValid',
    :'birth_name_valid' => :'birthNameValid',
    :'mrz_valid' => :'mrzValid',
    :'expired' => :'expired',
    :'valid' => :'valid'
  }
end
new(attributes = {}) click to toggle source

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

# File lib/yousign_client/models/check_document_identities_output.rb, line 158
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?(:'id')
    self.id = attributes[:'id']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Attribute type mapping.

# File lib/yousign_client/models/check_document_identities_output.rb, line 130
def self.swagger_types
  {
    :'id' => :'String',
    :'created_at' => :'DateTime',
    :'updated_at' => :'DateTime',
    :'first_names' => :'Array<String>',
    :'birth_name' => :'String',
    :'birth_date' => :'Date',
    :'workspace' => :'String',
    :'creator' => :'String',
    :'document_type' => :'String',
    :'extracted_first_names' => :'Array<String>',
    :'extracted_birth_name' => :'String',
    :'extracted_birth_date' => :'Date',
    :'extracted_gender' => :'String',
    :'extracted_issuance_date' => :'Date',
    :'extracted_expiration_date' => :'Date',
    :'extracted_mrz' => :'Array<String>',
    :'first_name_valid' => :'BOOLEAN',
    :'birth_name_valid' => :'BOOLEAN',
    :'mrz_valid' => :'BOOLEAN',
    :'expired' => :'BOOLEAN',
    :'valid' => :'BOOLEAN'
  }
end

Public Instance Methods

==(o) click to toggle source

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

# File lib/yousign_client/models/check_document_identities_output.rb, line 282
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      created_at == o.created_at &&
      updated_at == o.updated_at &&
      first_names == o.first_names &&
      birth_name == o.birth_name &&
      birth_date == o.birth_date &&
      workspace == o.workspace &&
      creator == o.creator &&
      document_type == o.document_type &&
      extracted_first_names == o.extracted_first_names &&
      extracted_birth_name == o.extracted_birth_name &&
      extracted_birth_date == o.extracted_birth_date &&
      extracted_gender == o.extracted_gender &&
      extracted_issuance_date == o.extracted_issuance_date &&
      extracted_expiration_date == o.extracted_expiration_date &&
      extracted_mrz == o.extracted_mrz &&
      first_name_valid == o.first_name_valid &&
      birth_name_valid == o.birth_name_valid &&
      mrz_valid == o.mrz_valid &&
      expired == o.expired &&
      valid == o.valid
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/yousign_client/models/check_document_identities_output.rb, line 344
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
    temp_model = YousignClient.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/yousign_client/models/check_document_identities_output.rb, line 410
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/yousign_client/models/check_document_identities_output.rb, line 323
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_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
document_type=(document_type) click to toggle source

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

# File lib/yousign_client/models/check_document_identities_output.rb, line 272
def document_type=(document_type)
  validator = EnumAttributeValidator.new('String', ['ID_CARD', 'PASSPORT'])
  unless validator.valid?(document_type)
    fail ArgumentError, 'invalid value for "document_type", must be one of #{validator.allowable_values}.'
  end
  @document_type = document_type
end
eql?(o) click to toggle source

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

# File lib/yousign_client/models/check_document_identities_output.rb, line 310
def eql?(o)
  self == o
end
hash() click to toggle source

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

# File lib/yousign_client/models/check_document_identities_output.rb, line 316
def hash
  [id, created_at, updated_at, first_names, birth_name, birth_date, workspace, creator, document_type, extracted_first_names, extracted_birth_name, extracted_birth_date, extracted_gender, extracted_issuance_date, extracted_expiration_date, extracted_mrz, first_name_valid, birth_name_valid, mrz_valid, expired, valid].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/yousign_client/models/check_document_identities_output.rb, line 257
def list_invalid_properties
  invalid_properties = Array.new
  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/yousign_client/models/check_document_identities_output.rb, line 390
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/yousign_client/models/check_document_identities_output.rb, line 396
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/yousign_client/models/check_document_identities_output.rb, line 384
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/yousign_client/models/check_document_identities_output.rb, line 264
def valid?
  document_type_validator = EnumAttributeValidator.new('String', ['ID_CARD', 'PASSPORT'])
  return false unless document_type_validator.valid?(@document_type)
  true
end