Class: FdxV660Api::GovernmentIssuedPartyIdentificationEntity

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/fdx_v660_api/models/government_issued_party_identification_entity.rb

Overview

Government issued identification document that is used to uniquely identify a person or business

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(id_number: SKIP, issued_date: SKIP, expiry_date: SKIP, type: SKIP, issuing_country_name: SKIP, additional_properties: nil) ⇒ GovernmentIssuedPartyIdentificationEntity

Returns a new instance of GovernmentIssuedPartyIdentificationEntity.



60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/fdx_v660_api/models/government_issued_party_identification_entity.rb', line 60

def initialize(id_number: SKIP, issued_date: SKIP, expiry_date: SKIP,
               type: SKIP, issuing_country_name: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id_number = id_number unless id_number == SKIP
  @issued_date = issued_date unless issued_date == SKIP
  @expiry_date = expiry_date unless expiry_date == SKIP
  @type = type unless type == SKIP
  @issuing_country_name = issuing_country_name unless issuing_country_name == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#expiry_dateString

Expiry date

Returns:

  • (String)


23
24
25
# File 'lib/fdx_v660_api/models/government_issued_party_identification_entity.rb', line 23

def expiry_date
  @expiry_date
end

#id_numberString

Identification number

Returns:

  • (String)


15
16
17
# File 'lib/fdx_v660_api/models/government_issued_party_identification_entity.rb', line 15

def id_number
  @id_number
end

#issued_dateString

Issued date

Returns:

  • (String)


19
20
21
# File 'lib/fdx_v660_api/models/government_issued_party_identification_entity.rb', line 19

def issued_date
  @issued_date
end

#issuing_country_nameString

Name of the issuing country

Returns:

  • (String)


31
32
33
# File 'lib/fdx_v660_api/models/government_issued_party_identification_entity.rb', line 31

def issuing_country_name
  @issuing_country_name
end

#typeGovernmentIssuedIdType2

Type of the identification



27
28
29
# File 'lib/fdx_v660_api/models/government_issued_party_identification_entity.rb', line 27

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/fdx_v660_api/models/government_issued_party_identification_entity.rb', line 75

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id_number = hash.key?('idNumber') ? hash['idNumber'] : SKIP
  issued_date = hash.key?('issuedDate') ? hash['issuedDate'] : SKIP
  expiry_date = hash.key?('expiryDate') ? hash['expiryDate'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  issuing_country_name =
    hash.key?('issuingCountryName') ? hash['issuingCountryName'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  GovernmentIssuedPartyIdentificationEntity.new(id_number: id_number,
                                                issued_date: issued_date,
                                                expiry_date: expiry_date,
                                                type: type,
                                                issuing_country_name: issuing_country_name,
                                                additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



34
35
36
37
38
39
40
41
42
# File 'lib/fdx_v660_api/models/government_issued_party_identification_entity.rb', line 34

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id_number'] = 'idNumber'
  @_hash['issued_date'] = 'issuedDate'
  @_hash['expiry_date'] = 'expiryDate'
  @_hash['type'] = 'type'
  @_hash['issuing_country_name'] = 'issuingCountryName'
  @_hash
end

.nullablesObject

An array for nullable fields



56
57
58
# File 'lib/fdx_v660_api/models/government_issued_party_identification_entity.rb', line 56

def self.nullables
  []
end

.optionalsObject

An array for optional fields



45
46
47
48
49
50
51
52
53
# File 'lib/fdx_v660_api/models/government_issued_party_identification_entity.rb', line 45

def self.optionals
  %w[
    id_number
    issued_date
    expiry_date
    type
    issuing_country_name
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



111
112
113
114
115
116
# File 'lib/fdx_v660_api/models/government_issued_party_identification_entity.rb', line 111

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id_number: #{@id_number.inspect}, issued_date: #{@issued_date.inspect},"\
  " expiry_date: #{@expiry_date.inspect}, type: #{@type.inspect}, issuing_country_name:"\
  " #{@issuing_country_name.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



103
104
105
106
107
108
# File 'lib/fdx_v660_api/models/government_issued_party_identification_entity.rb', line 103

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id_number: #{@id_number}, issued_date: #{@issued_date}, expiry_date:"\
  " #{@expiry_date}, type: #{@type}, issuing_country_name: #{@issuing_country_name},"\
  " additional_properties: #{@additional_properties}>"
end