trinsic_api 3.0.1 → 3.0.2.pre.preview

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/docs/AadhaarClaims.md +46 -0
  3. data/docs/AadhaarLanguage.md +20 -0
  4. data/docs/AadhaarLocalizedClaims.md +40 -0
  5. data/docs/AppleWalletInput.md +3 -1
  6. data/docs/ConnectIdAddress.md +26 -0
  7. data/docs/ConnectIdAgeVerification.md +20 -0
  8. data/docs/ConnectIdBeneficiaryAccount.md +24 -0
  9. data/docs/ConnectIdProviderOutput.md +38 -0
  10. data/docs/CzechMojeIdAddressOutput.md +28 -0
  11. data/docs/CzechMojeIdProviderOutput.md +62 -0
  12. data/docs/DigilockerAadhaarProviderOutput.md +30 -0
  13. data/docs/FaydaProviderOutput.md +7 -1
  14. data/docs/FinnishTrustNetworkProviderOutput.md +38 -0
  15. data/docs/FranceIdentiteInput.md +18 -0
  16. data/docs/FranceIdentiteProviderOutput.md +18 -0
  17. data/docs/FrejaIndirectProviderOutput.md +24 -0
  18. data/docs/FrejaProviderOutput.md +36 -8
  19. data/docs/GetProviderResponse.md +18 -0
  20. data/docs/GoogleWalletInput.md +3 -1
  21. data/docs/NigeriaNinLookup2ProviderOutput.md +40 -0
  22. data/docs/NorwegianBankIdProviderOutput.md +32 -0
  23. data/docs/OneIdProviderAddress.md +26 -0
  24. data/docs/OneIdProviderOutput.md +28 -0
  25. data/docs/OutputFrejaAddress.md +24 -0
  26. data/docs/OutputFrejaDocument.md +24 -0
  27. data/docs/PhilippinesDigitalNidProviderOutput.md +21 -1
  28. data/docs/PhilippinesPhysicalNidProviderOutput.md +17 -1
  29. data/docs/ProviderInput.md +6 -0
  30. data/docs/ProviderOutput.md +24 -2
  31. data/docs/ProvidersApi.md +70 -0
  32. data/docs/Raw18013DocumentRequest.md +20 -0
  33. data/docs/Raw18013RequestInput.md +18 -0
  34. data/docs/RecommendProvidersResponse.md +3 -1
  35. data/docs/SamsungWalletInput.md +18 -0
  36. data/docs/UkEvisaLookupInput.md +20 -0
  37. data/docs/UnitedKingdomEvisaProviderOutput.md +38 -0
  38. data/docs/VerificationProfileResponse.md +2 -0
  39. data/docs/VerificationProfilesApi.md +4 -0
  40. data/docs/YotiDeeplinkProviderOutput.md +40 -0
  41. data/lib/trinsic_api/api/providers_api.rb +63 -0
  42. data/lib/trinsic_api/api/verification_profiles_api.rb +6 -0
  43. data/lib/trinsic_api/models/aadhaar_claims.rb +376 -0
  44. data/lib/trinsic_api/models/aadhaar_language.rb +250 -0
  45. data/lib/trinsic_api/models/aadhaar_localized_claims.rb +343 -0
  46. data/lib/trinsic_api/models/apple_wallet_input.rb +16 -5
  47. data/lib/trinsic_api/models/connect_id_address.rb +266 -0
  48. data/lib/trinsic_api/models/connect_id_age_verification.rb +233 -0
  49. data/lib/trinsic_api/models/connect_id_beneficiary_account.rb +255 -0
  50. data/lib/trinsic_api/models/connect_id_provider_output.rb +333 -0
  51. data/lib/trinsic_api/models/czech_moje_id_address_output.rb +277 -0
  52. data/lib/trinsic_api/models/czech_moje_id_provider_output.rb +465 -0
  53. data/lib/trinsic_api/models/digilocker_aadhaar_provider_output.rb +305 -0
  54. data/lib/trinsic_api/models/fayda_provider_output.rb +38 -5
  55. data/lib/trinsic_api/models/finnish_trust_network_provider_output.rb +333 -0
  56. data/lib/trinsic_api/models/france_identite_input.rb +222 -0
  57. data/lib/trinsic_api/models/france_identite_provider_output.rb +239 -0
  58. data/lib/trinsic_api/models/freja_indirect_provider_output.rb +320 -0
  59. data/lib/trinsic_api/models/freja_provider_output.rb +185 -91
  60. data/lib/trinsic_api/models/get_provider_response.rb +238 -0
  61. data/lib/trinsic_api/models/google_wallet_input.rb +16 -5
  62. data/lib/trinsic_api/models/integration_step.rb +1 -1
  63. data/lib/trinsic_api/models/nigeria_nin_lookup2_provider_output.rb +392 -0
  64. data/lib/trinsic_api/models/norwegian_bank_id_provider_output.rb +300 -0
  65. data/lib/trinsic_api/models/one_id_provider_address.rb +266 -0
  66. data/lib/trinsic_api/models/one_id_provider_output.rb +278 -0
  67. data/lib/trinsic_api/models/output_freja_address.rb +255 -0
  68. data/lib/trinsic_api/models/output_freja_document.rb +255 -0
  69. data/lib/trinsic_api/models/philippines_digital_nid_provider_output.rb +114 -4
  70. data/lib/trinsic_api/models/philippines_physical_nid_provider_output.rb +92 -4
  71. data/lib/trinsic_api/models/provider_input.rb +34 -1
  72. data/lib/trinsic_api/models/provider_output.rb +127 -6
  73. data/lib/trinsic_api/models/raw18013_document_request.rb +276 -0
  74. data/lib/trinsic_api/models/raw18013_request_input.rb +259 -0
  75. data/lib/trinsic_api/models/recommend_providers_response.rb +33 -4
  76. data/lib/trinsic_api/models/samsung_wallet_input.rb +222 -0
  77. data/lib/trinsic_api/models/uk_evisa_lookup_input.rb +283 -0
  78. data/lib/trinsic_api/models/united_kingdom_evisa_provider_output.rb +333 -0
  79. data/lib/trinsic_api/models/verification_profile_response.rb +28 -1
  80. data/lib/trinsic_api/models/yoti_deeplink_provider_output.rb +344 -0
  81. data/lib/trinsic_api/version.rb +1 -1
  82. data/lib/trinsic_api.rb +27 -0
  83. data/spec/api/providers_api_spec.rb +12 -0
  84. data/spec/api/verification_profiles_api_spec.rb +2 -0
  85. data/spec/models/aadhaar_claims_spec.rb +120 -0
  86. data/spec/models/aadhaar_language_spec.rb +42 -0
  87. data/spec/models/aadhaar_localized_claims_spec.rb +102 -0
  88. data/spec/models/apple_wallet_input_spec.rb +6 -0
  89. data/spec/models/connect_id_address_spec.rb +60 -0
  90. data/spec/models/connect_id_age_verification_spec.rb +42 -0
  91. data/spec/models/connect_id_beneficiary_account_spec.rb +54 -0
  92. data/spec/models/connect_id_provider_output_spec.rb +96 -0
  93. data/spec/models/czech_moje_id_address_output_spec.rb +66 -0
  94. data/spec/models/czech_moje_id_provider_output_spec.rb +168 -0
  95. data/spec/models/digilocker_aadhaar_provider_output_spec.rb +72 -0
  96. data/spec/models/fayda_provider_output_spec.rb +18 -0
  97. data/spec/models/finnish_trust_network_provider_output_spec.rb +96 -0
  98. data/spec/models/france_identite_input_spec.rb +36 -0
  99. data/spec/models/france_identite_provider_output_spec.rb +36 -0
  100. data/spec/models/freja_indirect_provider_output_spec.rb +54 -0
  101. data/spec/models/freja_provider_output_spec.rb +88 -4
  102. data/spec/models/get_provider_response_spec.rb +36 -0
  103. data/spec/models/google_wallet_input_spec.rb +6 -0
  104. data/spec/models/nigeria_nin_lookup2_provider_output_spec.rb +102 -0
  105. data/spec/models/norwegian_bank_id_provider_output_spec.rb +78 -0
  106. data/spec/models/one_id_provider_address_spec.rb +60 -0
  107. data/spec/models/one_id_provider_output_spec.rb +66 -0
  108. data/spec/models/output_freja_address_spec.rb +54 -0
  109. data/spec/models/output_freja_document_spec.rb +54 -0
  110. data/spec/models/philippines_digital_nid_provider_output_spec.rb +60 -0
  111. data/spec/models/philippines_physical_nid_provider_output_spec.rb +48 -0
  112. data/spec/models/provider_input_spec.rb +18 -0
  113. data/spec/models/provider_output_spec.rb +66 -0
  114. data/spec/models/raw18013_document_request_spec.rb +42 -0
  115. data/spec/models/raw18013_request_input_spec.rb +36 -0
  116. data/spec/models/recommend_providers_response_spec.rb +6 -0
  117. data/spec/models/samsung_wallet_input_spec.rb +36 -0
  118. data/spec/models/uk_evisa_lookup_input_spec.rb +42 -0
  119. data/spec/models/united_kingdom_evisa_provider_output_spec.rb +96 -0
  120. data/spec/models/verification_profile_response_spec.rb +6 -0
  121. data/spec/models/yoti_deeplink_provider_output_spec.rb +102 -0
  122. metadata +230 -122
@@ -0,0 +1,255 @@
1
+ =begin
2
+ #Trinsic API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrinsicApi
17
+ class ConnectIdBeneficiaryAccount
18
+ # The beneficiary's name.
19
+ attr_accessor :beneficiary_name
20
+
21
+ # The bank state branch (BSB) which the account belongs to. This will be a six-digit number.
22
+ attr_accessor :account_bank_state_branch
23
+
24
+ # The account number.
25
+ attr_accessor :account_number
26
+
27
+ # The authority that verified the claim.
28
+ attr_accessor :trust_framework
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'beneficiary_name' => :'beneficiaryName',
34
+ :'account_bank_state_branch' => :'accountBankStateBranch',
35
+ :'account_number' => :'accountNumber',
36
+ :'trust_framework' => :'trustFramework'
37
+ }
38
+ end
39
+
40
+ # Returns attribute mapping this model knows about
41
+ def self.acceptable_attribute_map
42
+ attribute_map
43
+ end
44
+
45
+ # Returns all the JSON keys this model knows about
46
+ def self.acceptable_attributes
47
+ acceptable_attribute_map.values
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'beneficiary_name' => :'String',
54
+ :'account_bank_state_branch' => :'String',
55
+ :'account_number' => :'String',
56
+ :'trust_framework' => :'String'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ :'beneficiary_name',
64
+ :'account_bank_state_branch',
65
+ :'account_number',
66
+ :'trust_framework'
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::ConnectIdBeneficiaryAccount` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ acceptable_attribute_map = self.class.acceptable_attribute_map
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!acceptable_attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::ConnectIdBeneficiaryAccount`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'beneficiary_name')
87
+ self.beneficiary_name = attributes[:'beneficiary_name']
88
+ end
89
+
90
+ if attributes.key?(:'account_bank_state_branch')
91
+ self.account_bank_state_branch = attributes[:'account_bank_state_branch']
92
+ end
93
+
94
+ if attributes.key?(:'account_number')
95
+ self.account_number = attributes[:'account_number']
96
+ end
97
+
98
+ if attributes.key?(:'trust_framework')
99
+ self.trust_framework = attributes[:'trust_framework']
100
+ end
101
+ end
102
+
103
+ # Show invalid properties with the reasons. Usually used together with valid?
104
+ # @return Array for valid properties with the reasons
105
+ def list_invalid_properties
106
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
107
+ invalid_properties = Array.new
108
+ invalid_properties
109
+ end
110
+
111
+ # Check to see if the all the properties in the model are valid
112
+ # @return true if the model is valid
113
+ def valid?
114
+ warn '[DEPRECATED] the `valid?` method is obsolete'
115
+ true
116
+ end
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] Object to be compared
120
+ def ==(o)
121
+ return true if self.equal?(o)
122
+ self.class == o.class &&
123
+ beneficiary_name == o.beneficiary_name &&
124
+ account_bank_state_branch == o.account_bank_state_branch &&
125
+ account_number == o.account_number &&
126
+ trust_framework == o.trust_framework
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Integer] Hash code
137
+ def hash
138
+ [beneficiary_name, account_bank_state_branch, account_number, trust_framework].hash
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def self.build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ attributes = attributes.transform_keys(&:to_sym)
147
+ transformed_hash = {}
148
+ openapi_types.each_pair do |key, type|
149
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = nil
151
+ elsif type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[attribute_map[key]].is_a?(Array)
155
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
156
+ end
157
+ elsif !attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
159
+ end
160
+ end
161
+ new(transformed_hash)
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def self._deserialize(type, value)
169
+ case type.to_sym
170
+ when :Time
171
+ Time.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :Boolean
181
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ # models (e.g. Pet) or oneOf
202
+ klass = TrinsicApi.const_get(type)
203
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
204
+ end
205
+ end
206
+
207
+ # Returns the string representation of the object
208
+ # @return [String] String presentation of the object
209
+ def to_s
210
+ to_hash.to_s
211
+ end
212
+
213
+ # to_body is an alias to to_hash (backward compatibility)
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_body
216
+ to_hash
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ if value.nil?
226
+ is_nullable = self.class.openapi_nullable.include?(attr)
227
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
228
+ end
229
+
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ # Outputs non-array value in the form of hash
236
+ # For object, use to_hash. Otherwise, just return the value
237
+ # @param [Object] value Any valid value
238
+ # @return [Hash] Returns the value in the form of hash
239
+ def _to_hash(value)
240
+ if value.is_a?(Array)
241
+ value.compact.map { |v| _to_hash(v) }
242
+ elsif value.is_a?(Hash)
243
+ {}.tap do |hash|
244
+ value.each { |k, v| hash[k] = _to_hash(v) }
245
+ end
246
+ elsif value.respond_to? :to_hash
247
+ value.to_hash
248
+ else
249
+ value
250
+ end
251
+ end
252
+
253
+ end
254
+
255
+ end
@@ -0,0 +1,333 @@
1
+ =begin
2
+ #Trinsic API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrinsicApi
17
+ # Exposed properties for the `australia-connect-id` Provider which do not directly map to the normalized IdentityData model.
18
+ class ConnectIdProviderOutput
19
+ # The date of birth of an individual in YYYY-MM-DD format.
20
+ attr_accessor :birthdate
21
+
22
+ # The given name of an individual.
23
+ attr_accessor :given_name
24
+
25
+ # The middle name of an individual.
26
+ attr_accessor :middle_name
27
+
28
+ # The family/last name of an individual.
29
+ attr_accessor :family_name
30
+
31
+ # The phone number of an individual.
32
+ attr_accessor :phone_number
33
+
34
+ # The email of an individual.
35
+ attr_accessor :email
36
+
37
+ # The OpenID Connect (OIDC) subject identifier (sub).
38
+ attr_accessor :sub
39
+
40
+ # The age verification claim and whether the individual meets the age requirement.
41
+ attr_accessor :age_verification
42
+
43
+ # The verification session's transaction number. This is a unique identifier assigned to a single ConnectID transaction flow. It can be used for audit purposes or to flag fraudulent activity.
44
+ attr_accessor :transaction
45
+
46
+ # The beneficiary account that has been designated by the individual.
47
+ attr_accessor :beneficiary_account
48
+
49
+ # The address.
50
+ attr_accessor :address
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'birthdate' => :'birthdate',
56
+ :'given_name' => :'givenName',
57
+ :'middle_name' => :'middleName',
58
+ :'family_name' => :'familyName',
59
+ :'phone_number' => :'phoneNumber',
60
+ :'email' => :'email',
61
+ :'sub' => :'sub',
62
+ :'age_verification' => :'ageVerification',
63
+ :'transaction' => :'transaction',
64
+ :'beneficiary_account' => :'beneficiaryAccount',
65
+ :'address' => :'address'
66
+ }
67
+ end
68
+
69
+ # Returns attribute mapping this model knows about
70
+ def self.acceptable_attribute_map
71
+ attribute_map
72
+ end
73
+
74
+ # Returns all the JSON keys this model knows about
75
+ def self.acceptable_attributes
76
+ acceptable_attribute_map.values
77
+ end
78
+
79
+ # Attribute type mapping.
80
+ def self.openapi_types
81
+ {
82
+ :'birthdate' => :'Date',
83
+ :'given_name' => :'String',
84
+ :'middle_name' => :'String',
85
+ :'family_name' => :'String',
86
+ :'phone_number' => :'String',
87
+ :'email' => :'String',
88
+ :'sub' => :'String',
89
+ :'age_verification' => :'ConnectIdAgeVerification',
90
+ :'transaction' => :'String',
91
+ :'beneficiary_account' => :'ConnectIdBeneficiaryAccount',
92
+ :'address' => :'ConnectIdAddress'
93
+ }
94
+ end
95
+
96
+ # List of attributes with nullable: true
97
+ def self.openapi_nullable
98
+ Set.new([
99
+ :'birthdate',
100
+ :'given_name',
101
+ :'middle_name',
102
+ :'family_name',
103
+ :'phone_number',
104
+ :'email',
105
+ :'sub',
106
+ :'age_verification',
107
+ :'transaction',
108
+ :'beneficiary_account',
109
+ :'address'
110
+ ])
111
+ end
112
+
113
+ # Initializes the object
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ def initialize(attributes = {})
116
+ if (!attributes.is_a?(Hash))
117
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::ConnectIdProviderOutput` initialize method"
118
+ end
119
+
120
+ # check to see if the attribute exists and convert string to symbol for hash key
121
+ acceptable_attribute_map = self.class.acceptable_attribute_map
122
+ attributes = attributes.each_with_object({}) { |(k, v), h|
123
+ if (!acceptable_attribute_map.key?(k.to_sym))
124
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::ConnectIdProviderOutput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
125
+ end
126
+ h[k.to_sym] = v
127
+ }
128
+
129
+ if attributes.key?(:'birthdate')
130
+ self.birthdate = attributes[:'birthdate']
131
+ end
132
+
133
+ if attributes.key?(:'given_name')
134
+ self.given_name = attributes[:'given_name']
135
+ end
136
+
137
+ if attributes.key?(:'middle_name')
138
+ self.middle_name = attributes[:'middle_name']
139
+ end
140
+
141
+ if attributes.key?(:'family_name')
142
+ self.family_name = attributes[:'family_name']
143
+ end
144
+
145
+ if attributes.key?(:'phone_number')
146
+ self.phone_number = attributes[:'phone_number']
147
+ end
148
+
149
+ if attributes.key?(:'email')
150
+ self.email = attributes[:'email']
151
+ end
152
+
153
+ if attributes.key?(:'sub')
154
+ self.sub = attributes[:'sub']
155
+ end
156
+
157
+ if attributes.key?(:'age_verification')
158
+ self.age_verification = attributes[:'age_verification']
159
+ end
160
+
161
+ if attributes.key?(:'transaction')
162
+ self.transaction = attributes[:'transaction']
163
+ end
164
+
165
+ if attributes.key?(:'beneficiary_account')
166
+ self.beneficiary_account = attributes[:'beneficiary_account']
167
+ end
168
+
169
+ if attributes.key?(:'address')
170
+ self.address = attributes[:'address']
171
+ end
172
+ end
173
+
174
+ # Show invalid properties with the reasons. Usually used together with valid?
175
+ # @return Array for valid properties with the reasons
176
+ def list_invalid_properties
177
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
178
+ invalid_properties = Array.new
179
+ invalid_properties
180
+ end
181
+
182
+ # Check to see if the all the properties in the model are valid
183
+ # @return true if the model is valid
184
+ def valid?
185
+ warn '[DEPRECATED] the `valid?` method is obsolete'
186
+ true
187
+ end
188
+
189
+ # Checks equality by comparing each attribute.
190
+ # @param [Object] Object to be compared
191
+ def ==(o)
192
+ return true if self.equal?(o)
193
+ self.class == o.class &&
194
+ birthdate == o.birthdate &&
195
+ given_name == o.given_name &&
196
+ middle_name == o.middle_name &&
197
+ family_name == o.family_name &&
198
+ phone_number == o.phone_number &&
199
+ email == o.email &&
200
+ sub == o.sub &&
201
+ age_verification == o.age_verification &&
202
+ transaction == o.transaction &&
203
+ beneficiary_account == o.beneficiary_account &&
204
+ address == o.address
205
+ end
206
+
207
+ # @see the `==` method
208
+ # @param [Object] Object to be compared
209
+ def eql?(o)
210
+ self == o
211
+ end
212
+
213
+ # Calculates hash code according to all attributes.
214
+ # @return [Integer] Hash code
215
+ def hash
216
+ [birthdate, given_name, middle_name, family_name, phone_number, email, sub, age_verification, transaction, beneficiary_account, address].hash
217
+ end
218
+
219
+ # Builds the object from hash
220
+ # @param [Hash] attributes Model attributes in the form of hash
221
+ # @return [Object] Returns the model itself
222
+ def self.build_from_hash(attributes)
223
+ return nil unless attributes.is_a?(Hash)
224
+ attributes = attributes.transform_keys(&:to_sym)
225
+ transformed_hash = {}
226
+ openapi_types.each_pair do |key, type|
227
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
228
+ transformed_hash["#{key}"] = nil
229
+ elsif type =~ /\AArray<(.*)>/i
230
+ # check to ensure the input is an array given that the attribute
231
+ # is documented as an array but the input is not
232
+ if attributes[attribute_map[key]].is_a?(Array)
233
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
234
+ end
235
+ elsif !attributes[attribute_map[key]].nil?
236
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
237
+ end
238
+ end
239
+ new(transformed_hash)
240
+ end
241
+
242
+ # Deserializes the data based on type
243
+ # @param string type Data type
244
+ # @param string value Value to be deserialized
245
+ # @return [Object] Deserialized data
246
+ def self._deserialize(type, value)
247
+ case type.to_sym
248
+ when :Time
249
+ Time.parse(value)
250
+ when :Date
251
+ Date.parse(value)
252
+ when :String
253
+ value.to_s
254
+ when :Integer
255
+ value.to_i
256
+ when :Float
257
+ value.to_f
258
+ when :Boolean
259
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
260
+ true
261
+ else
262
+ false
263
+ end
264
+ when :Object
265
+ # generic object (usually a Hash), return directly
266
+ value
267
+ when /\AArray<(?<inner_type>.+)>\z/
268
+ inner_type = Regexp.last_match[:inner_type]
269
+ value.map { |v| _deserialize(inner_type, v) }
270
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
271
+ k_type = Regexp.last_match[:k_type]
272
+ v_type = Regexp.last_match[:v_type]
273
+ {}.tap do |hash|
274
+ value.each do |k, v|
275
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
276
+ end
277
+ end
278
+ else # model
279
+ # models (e.g. Pet) or oneOf
280
+ klass = TrinsicApi.const_get(type)
281
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
282
+ end
283
+ end
284
+
285
+ # Returns the string representation of the object
286
+ # @return [String] String presentation of the object
287
+ def to_s
288
+ to_hash.to_s
289
+ end
290
+
291
+ # to_body is an alias to to_hash (backward compatibility)
292
+ # @return [Hash] Returns the object in the form of hash
293
+ def to_body
294
+ to_hash
295
+ end
296
+
297
+ # Returns the object in the form of hash
298
+ # @return [Hash] Returns the object in the form of hash
299
+ def to_hash
300
+ hash = {}
301
+ self.class.attribute_map.each_pair do |attr, param|
302
+ value = self.send(attr)
303
+ if value.nil?
304
+ is_nullable = self.class.openapi_nullable.include?(attr)
305
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
306
+ end
307
+
308
+ hash[param] = _to_hash(value)
309
+ end
310
+ hash
311
+ end
312
+
313
+ # Outputs non-array value in the form of hash
314
+ # For object, use to_hash. Otherwise, just return the value
315
+ # @param [Object] value Any valid value
316
+ # @return [Hash] Returns the value in the form of hash
317
+ def _to_hash(value)
318
+ if value.is_a?(Array)
319
+ value.compact.map { |v| _to_hash(v) }
320
+ elsif value.is_a?(Hash)
321
+ {}.tap do |hash|
322
+ value.each { |k, v| hash[k] = _to_hash(v) }
323
+ end
324
+ elsif value.respond_to? :to_hash
325
+ value.to_hash
326
+ else
327
+ value
328
+ end
329
+ end
330
+
331
+ end
332
+
333
+ end