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.
- checksums.yaml +4 -4
- data/docs/AadhaarClaims.md +46 -0
- data/docs/AadhaarLanguage.md +20 -0
- data/docs/AadhaarLocalizedClaims.md +40 -0
- data/docs/AppleWalletInput.md +3 -1
- data/docs/ConnectIdAddress.md +26 -0
- data/docs/ConnectIdAgeVerification.md +20 -0
- data/docs/ConnectIdBeneficiaryAccount.md +24 -0
- data/docs/ConnectIdProviderOutput.md +38 -0
- data/docs/CzechMojeIdAddressOutput.md +28 -0
- data/docs/CzechMojeIdProviderOutput.md +62 -0
- data/docs/DigilockerAadhaarProviderOutput.md +30 -0
- data/docs/FaydaProviderOutput.md +7 -1
- data/docs/FinnishTrustNetworkProviderOutput.md +38 -0
- data/docs/FranceIdentiteInput.md +18 -0
- data/docs/FranceIdentiteProviderOutput.md +18 -0
- data/docs/FrejaIndirectProviderOutput.md +24 -0
- data/docs/FrejaProviderOutput.md +36 -8
- data/docs/GetProviderResponse.md +18 -0
- data/docs/GoogleWalletInput.md +3 -1
- data/docs/NigeriaNinLookup2ProviderOutput.md +40 -0
- data/docs/NorwegianBankIdProviderOutput.md +32 -0
- data/docs/OneIdProviderAddress.md +26 -0
- data/docs/OneIdProviderOutput.md +28 -0
- data/docs/OutputFrejaAddress.md +24 -0
- data/docs/OutputFrejaDocument.md +24 -0
- data/docs/PhilippinesDigitalNidProviderOutput.md +21 -1
- data/docs/PhilippinesPhysicalNidProviderOutput.md +17 -1
- data/docs/ProviderInput.md +6 -0
- data/docs/ProviderOutput.md +24 -2
- data/docs/ProvidersApi.md +70 -0
- data/docs/Raw18013DocumentRequest.md +20 -0
- data/docs/Raw18013RequestInput.md +18 -0
- data/docs/RecommendProvidersResponse.md +3 -1
- data/docs/SamsungWalletInput.md +18 -0
- data/docs/UkEvisaLookupInput.md +20 -0
- data/docs/UnitedKingdomEvisaProviderOutput.md +38 -0
- data/docs/VerificationProfileResponse.md +2 -0
- data/docs/VerificationProfilesApi.md +4 -0
- data/docs/YotiDeeplinkProviderOutput.md +40 -0
- data/lib/trinsic_api/api/providers_api.rb +63 -0
- data/lib/trinsic_api/api/verification_profiles_api.rb +6 -0
- data/lib/trinsic_api/models/aadhaar_claims.rb +376 -0
- data/lib/trinsic_api/models/aadhaar_language.rb +250 -0
- data/lib/trinsic_api/models/aadhaar_localized_claims.rb +343 -0
- data/lib/trinsic_api/models/apple_wallet_input.rb +16 -5
- data/lib/trinsic_api/models/connect_id_address.rb +266 -0
- data/lib/trinsic_api/models/connect_id_age_verification.rb +233 -0
- data/lib/trinsic_api/models/connect_id_beneficiary_account.rb +255 -0
- data/lib/trinsic_api/models/connect_id_provider_output.rb +333 -0
- data/lib/trinsic_api/models/czech_moje_id_address_output.rb +277 -0
- data/lib/trinsic_api/models/czech_moje_id_provider_output.rb +465 -0
- data/lib/trinsic_api/models/digilocker_aadhaar_provider_output.rb +305 -0
- data/lib/trinsic_api/models/fayda_provider_output.rb +38 -5
- data/lib/trinsic_api/models/finnish_trust_network_provider_output.rb +333 -0
- data/lib/trinsic_api/models/france_identite_input.rb +222 -0
- data/lib/trinsic_api/models/france_identite_provider_output.rb +239 -0
- data/lib/trinsic_api/models/freja_indirect_provider_output.rb +320 -0
- data/lib/trinsic_api/models/freja_provider_output.rb +185 -91
- data/lib/trinsic_api/models/get_provider_response.rb +238 -0
- data/lib/trinsic_api/models/google_wallet_input.rb +16 -5
- data/lib/trinsic_api/models/integration_step.rb +1 -1
- data/lib/trinsic_api/models/nigeria_nin_lookup2_provider_output.rb +392 -0
- data/lib/trinsic_api/models/norwegian_bank_id_provider_output.rb +300 -0
- data/lib/trinsic_api/models/one_id_provider_address.rb +266 -0
- data/lib/trinsic_api/models/one_id_provider_output.rb +278 -0
- data/lib/trinsic_api/models/output_freja_address.rb +255 -0
- data/lib/trinsic_api/models/output_freja_document.rb +255 -0
- data/lib/trinsic_api/models/philippines_digital_nid_provider_output.rb +114 -4
- data/lib/trinsic_api/models/philippines_physical_nid_provider_output.rb +92 -4
- data/lib/trinsic_api/models/provider_input.rb +34 -1
- data/lib/trinsic_api/models/provider_output.rb +127 -6
- data/lib/trinsic_api/models/raw18013_document_request.rb +276 -0
- data/lib/trinsic_api/models/raw18013_request_input.rb +259 -0
- data/lib/trinsic_api/models/recommend_providers_response.rb +33 -4
- data/lib/trinsic_api/models/samsung_wallet_input.rb +222 -0
- data/lib/trinsic_api/models/uk_evisa_lookup_input.rb +283 -0
- data/lib/trinsic_api/models/united_kingdom_evisa_provider_output.rb +333 -0
- data/lib/trinsic_api/models/verification_profile_response.rb +28 -1
- data/lib/trinsic_api/models/yoti_deeplink_provider_output.rb +344 -0
- data/lib/trinsic_api/version.rb +1 -1
- data/lib/trinsic_api.rb +27 -0
- data/spec/api/providers_api_spec.rb +12 -0
- data/spec/api/verification_profiles_api_spec.rb +2 -0
- data/spec/models/aadhaar_claims_spec.rb +120 -0
- data/spec/models/aadhaar_language_spec.rb +42 -0
- data/spec/models/aadhaar_localized_claims_spec.rb +102 -0
- data/spec/models/apple_wallet_input_spec.rb +6 -0
- data/spec/models/connect_id_address_spec.rb +60 -0
- data/spec/models/connect_id_age_verification_spec.rb +42 -0
- data/spec/models/connect_id_beneficiary_account_spec.rb +54 -0
- data/spec/models/connect_id_provider_output_spec.rb +96 -0
- data/spec/models/czech_moje_id_address_output_spec.rb +66 -0
- data/spec/models/czech_moje_id_provider_output_spec.rb +168 -0
- data/spec/models/digilocker_aadhaar_provider_output_spec.rb +72 -0
- data/spec/models/fayda_provider_output_spec.rb +18 -0
- data/spec/models/finnish_trust_network_provider_output_spec.rb +96 -0
- data/spec/models/france_identite_input_spec.rb +36 -0
- data/spec/models/france_identite_provider_output_spec.rb +36 -0
- data/spec/models/freja_indirect_provider_output_spec.rb +54 -0
- data/spec/models/freja_provider_output_spec.rb +88 -4
- data/spec/models/get_provider_response_spec.rb +36 -0
- data/spec/models/google_wallet_input_spec.rb +6 -0
- data/spec/models/nigeria_nin_lookup2_provider_output_spec.rb +102 -0
- data/spec/models/norwegian_bank_id_provider_output_spec.rb +78 -0
- data/spec/models/one_id_provider_address_spec.rb +60 -0
- data/spec/models/one_id_provider_output_spec.rb +66 -0
- data/spec/models/output_freja_address_spec.rb +54 -0
- data/spec/models/output_freja_document_spec.rb +54 -0
- data/spec/models/philippines_digital_nid_provider_output_spec.rb +60 -0
- data/spec/models/philippines_physical_nid_provider_output_spec.rb +48 -0
- data/spec/models/provider_input_spec.rb +18 -0
- data/spec/models/provider_output_spec.rb +66 -0
- data/spec/models/raw18013_document_request_spec.rb +42 -0
- data/spec/models/raw18013_request_input_spec.rb +36 -0
- data/spec/models/recommend_providers_response_spec.rb +6 -0
- data/spec/models/samsung_wallet_input_spec.rb +36 -0
- data/spec/models/uk_evisa_lookup_input_spec.rb +42 -0
- data/spec/models/united_kingdom_evisa_provider_output_spec.rb +96 -0
- data/spec/models/verification_profile_response_spec.rb +6 -0
- data/spec/models/yoti_deeplink_provider_output_spec.rb +102 -0
- metadata +230 -122
|
@@ -19,6 +19,69 @@ module TrinsicApi
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
+
# Get Provider
|
|
23
|
+
# Get a single identity provider by ID, including its license status.
|
|
24
|
+
# @param provider_id [String] The ID of the provider to retrieve
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [GetProviderResponse]
|
|
27
|
+
def get_provider(provider_id, opts = {})
|
|
28
|
+
data, _status_code, _headers = get_provider_with_http_info(provider_id, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get Provider
|
|
33
|
+
# Get a single identity provider by ID, including its license status.
|
|
34
|
+
# @param provider_id [String] The ID of the provider to retrieve
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(GetProviderResponse, Integer, Hash)>] GetProviderResponse data, response status code and response headers
|
|
37
|
+
def get_provider_with_http_info(provider_id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: ProvidersApi.get_provider ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'provider_id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && provider_id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'provider_id' when calling ProvidersApi.get_provider"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/api/v1/providers/{providerId}'.sub('{' + 'providerId' + '}', CGI.escape(provider_id.to_s))
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/problem+json']) unless header_params['Accept']
|
|
55
|
+
|
|
56
|
+
# form parameters
|
|
57
|
+
form_params = opts[:form_params] || {}
|
|
58
|
+
|
|
59
|
+
# http body (model)
|
|
60
|
+
post_body = opts[:debug_body]
|
|
61
|
+
|
|
62
|
+
# return_type
|
|
63
|
+
return_type = opts[:debug_return_type] || 'GetProviderResponse'
|
|
64
|
+
|
|
65
|
+
# auth_names
|
|
66
|
+
auth_names = opts[:debug_auth_names] || ['Bearer']
|
|
67
|
+
|
|
68
|
+
new_options = opts.merge(
|
|
69
|
+
:operation => :"ProvidersApi.get_provider",
|
|
70
|
+
:header_params => header_params,
|
|
71
|
+
:query_params => query_params,
|
|
72
|
+
:form_params => form_params,
|
|
73
|
+
:body => post_body,
|
|
74
|
+
:auth_names => auth_names,
|
|
75
|
+
:return_type => return_type
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
79
|
+
if @api_client.config.debugging
|
|
80
|
+
@api_client.config.logger.debug "API called: ProvidersApi#get_provider\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
+
end
|
|
82
|
+
return data, status_code, headers
|
|
83
|
+
end
|
|
84
|
+
|
|
22
85
|
# List Providers
|
|
23
86
|
# List all identity providers available to your Organization, including their license status.
|
|
24
87
|
# @param [Hash] opts the optional parameters
|
|
@@ -27,6 +27,8 @@ module TrinsicApi
|
|
|
27
27
|
# @option opts [String] :primary_color The primary color of the verification profile. Must be a 6-character hex string prefixed with a '#' character. Example: #000000
|
|
28
28
|
# @option opts [Array<String>] :providers The list of providers you'd like to select for this profile. We will not currently enable any providers.
|
|
29
29
|
# @option opts [File] :logo The logo of the verification profile.
|
|
30
|
+
# @option opts [String] :redaction_period The redaction period for verification data. Must be between 0 and 31 days, and at least 15 minutes greater than the session expiration. If not specified, defaults to 31 days.
|
|
31
|
+
# @option opts [String] :session_expiration The session expiration for verification sessions created with this profile. Must be between 15 minutes and 24 hours. Defaults to 1 hour if not specified.
|
|
30
32
|
# @option opts [Boolean] :is_production_usage Whether this profile is for production usage. Only applicable for Live environment profiles. If not specified for Live profiles, defaults to false (Demo).
|
|
31
33
|
# @return [CreateVerificationProfileResponse]
|
|
32
34
|
def create_verification_profile(_alias, brand_name, opts = {})
|
|
@@ -42,6 +44,8 @@ module TrinsicApi
|
|
|
42
44
|
# @option opts [String] :primary_color The primary color of the verification profile. Must be a 6-character hex string prefixed with a '#' character. Example: #000000
|
|
43
45
|
# @option opts [Array<String>] :providers The list of providers you'd like to select for this profile. We will not currently enable any providers.
|
|
44
46
|
# @option opts [File] :logo The logo of the verification profile.
|
|
47
|
+
# @option opts [String] :redaction_period The redaction period for verification data. Must be between 0 and 31 days, and at least 15 minutes greater than the session expiration. If not specified, defaults to 31 days.
|
|
48
|
+
# @option opts [String] :session_expiration The session expiration for verification sessions created with this profile. Must be between 15 minutes and 24 hours. Defaults to 1 hour if not specified.
|
|
45
49
|
# @option opts [Boolean] :is_production_usage Whether this profile is for production usage. Only applicable for Live environment profiles. If not specified for Live profiles, defaults to false (Demo).
|
|
46
50
|
# @return [Array<(CreateVerificationProfileResponse, Integer, Hash)>] CreateVerificationProfileResponse data, response status code and response headers
|
|
47
51
|
def create_verification_profile_with_http_info(_alias, brand_name, opts = {})
|
|
@@ -103,6 +107,8 @@ module TrinsicApi
|
|
|
103
107
|
form_params['PrimaryColor'] = opts[:'primary_color'] if !opts[:'primary_color'].nil?
|
|
104
108
|
form_params['Providers'] = @api_client.build_collection_param(opts[:'providers'], :multi) if !opts[:'providers'].nil?
|
|
105
109
|
form_params['Logo'] = opts[:'logo'] if !opts[:'logo'].nil?
|
|
110
|
+
form_params['RedactionPeriod'] = opts[:'redaction_period'] if !opts[:'redaction_period'].nil?
|
|
111
|
+
form_params['SessionExpiration'] = opts[:'session_expiration'] if !opts[:'session_expiration'].nil?
|
|
106
112
|
form_params['IsProductionUsage'] = opts[:'is_production_usage'] if !opts[:'is_production_usage'].nil?
|
|
107
113
|
|
|
108
114
|
# http body (model)
|
|
@@ -0,0 +1,376 @@
|
|
|
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 AadhaarClaims
|
|
18
|
+
# The full name.
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
|
|
21
|
+
# The date of birth. The format is YYYY-MM-DD.
|
|
22
|
+
attr_accessor :date_of_birth
|
|
23
|
+
|
|
24
|
+
# The gender of the individual. Possible values: - M (Male) - F (Female) - T (Transgender)
|
|
25
|
+
attr_accessor :gender
|
|
26
|
+
|
|
27
|
+
# The address's care-of field. This indicates that mail should be delivered to an individual through another person or entity who is a known resident at the address.
|
|
28
|
+
attr_accessor :care_of
|
|
29
|
+
|
|
30
|
+
# The address's country. This is formatted as an alpha-2 country code.
|
|
31
|
+
attr_accessor :country
|
|
32
|
+
|
|
33
|
+
# The address's district.
|
|
34
|
+
attr_accessor :district
|
|
35
|
+
|
|
36
|
+
# The identifier for the house address.
|
|
37
|
+
attr_accessor :house
|
|
38
|
+
|
|
39
|
+
# The location or locality that helps identify where the address is within a city.
|
|
40
|
+
attr_accessor :location
|
|
41
|
+
|
|
42
|
+
# A landmark near the address.
|
|
43
|
+
attr_accessor :landmark
|
|
44
|
+
|
|
45
|
+
# The address's postal code.
|
|
46
|
+
attr_accessor :postal_code
|
|
47
|
+
|
|
48
|
+
# The address's post office.
|
|
49
|
+
attr_accessor :post_office
|
|
50
|
+
|
|
51
|
+
# The address's state or union territory.
|
|
52
|
+
attr_accessor :state
|
|
53
|
+
|
|
54
|
+
# The address's street name.
|
|
55
|
+
attr_accessor :street
|
|
56
|
+
|
|
57
|
+
# The address's subdistrict.
|
|
58
|
+
attr_accessor :subdistrict
|
|
59
|
+
|
|
60
|
+
# The address's village/town/city.
|
|
61
|
+
attr_accessor :village_town_city
|
|
62
|
+
|
|
63
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
64
|
+
def self.attribute_map
|
|
65
|
+
{
|
|
66
|
+
:'name' => :'name',
|
|
67
|
+
:'date_of_birth' => :'dateOfBirth',
|
|
68
|
+
:'gender' => :'gender',
|
|
69
|
+
:'care_of' => :'careOf',
|
|
70
|
+
:'country' => :'country',
|
|
71
|
+
:'district' => :'district',
|
|
72
|
+
:'house' => :'house',
|
|
73
|
+
:'location' => :'location',
|
|
74
|
+
:'landmark' => :'landmark',
|
|
75
|
+
:'postal_code' => :'postalCode',
|
|
76
|
+
:'post_office' => :'postOffice',
|
|
77
|
+
:'state' => :'state',
|
|
78
|
+
:'street' => :'street',
|
|
79
|
+
:'subdistrict' => :'subdistrict',
|
|
80
|
+
:'village_town_city' => :'villageTownCity'
|
|
81
|
+
}
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Returns attribute mapping this model knows about
|
|
85
|
+
def self.acceptable_attribute_map
|
|
86
|
+
attribute_map
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Returns all the JSON keys this model knows about
|
|
90
|
+
def self.acceptable_attributes
|
|
91
|
+
acceptable_attribute_map.values
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Attribute type mapping.
|
|
95
|
+
def self.openapi_types
|
|
96
|
+
{
|
|
97
|
+
:'name' => :'String',
|
|
98
|
+
:'date_of_birth' => :'Date',
|
|
99
|
+
:'gender' => :'String',
|
|
100
|
+
:'care_of' => :'String',
|
|
101
|
+
:'country' => :'String',
|
|
102
|
+
:'district' => :'String',
|
|
103
|
+
:'house' => :'String',
|
|
104
|
+
:'location' => :'String',
|
|
105
|
+
:'landmark' => :'String',
|
|
106
|
+
:'postal_code' => :'String',
|
|
107
|
+
:'post_office' => :'String',
|
|
108
|
+
:'state' => :'String',
|
|
109
|
+
:'street' => :'String',
|
|
110
|
+
:'subdistrict' => :'String',
|
|
111
|
+
:'village_town_city' => :'String'
|
|
112
|
+
}
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# List of attributes with nullable: true
|
|
116
|
+
def self.openapi_nullable
|
|
117
|
+
Set.new([
|
|
118
|
+
:'name',
|
|
119
|
+
:'date_of_birth',
|
|
120
|
+
:'gender',
|
|
121
|
+
:'care_of',
|
|
122
|
+
:'country',
|
|
123
|
+
:'district',
|
|
124
|
+
:'house',
|
|
125
|
+
:'location',
|
|
126
|
+
:'landmark',
|
|
127
|
+
:'postal_code',
|
|
128
|
+
:'post_office',
|
|
129
|
+
:'state',
|
|
130
|
+
:'street',
|
|
131
|
+
:'subdistrict',
|
|
132
|
+
:'village_town_city'
|
|
133
|
+
])
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Initializes the object
|
|
137
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
138
|
+
def initialize(attributes = {})
|
|
139
|
+
if (!attributes.is_a?(Hash))
|
|
140
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::AadhaarClaims` initialize method"
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
144
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
145
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
146
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
147
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::AadhaarClaims`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
148
|
+
end
|
|
149
|
+
h[k.to_sym] = v
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'name')
|
|
153
|
+
self.name = attributes[:'name']
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'date_of_birth')
|
|
157
|
+
self.date_of_birth = attributes[:'date_of_birth']
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if attributes.key?(:'gender')
|
|
161
|
+
self.gender = attributes[:'gender']
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if attributes.key?(:'care_of')
|
|
165
|
+
self.care_of = attributes[:'care_of']
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if attributes.key?(:'country')
|
|
169
|
+
self.country = attributes[:'country']
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if attributes.key?(:'district')
|
|
173
|
+
self.district = attributes[:'district']
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if attributes.key?(:'house')
|
|
177
|
+
self.house = attributes[:'house']
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
if attributes.key?(:'location')
|
|
181
|
+
self.location = attributes[:'location']
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
if attributes.key?(:'landmark')
|
|
185
|
+
self.landmark = attributes[:'landmark']
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if attributes.key?(:'postal_code')
|
|
189
|
+
self.postal_code = attributes[:'postal_code']
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if attributes.key?(:'post_office')
|
|
193
|
+
self.post_office = attributes[:'post_office']
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
if attributes.key?(:'state')
|
|
197
|
+
self.state = attributes[:'state']
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if attributes.key?(:'street')
|
|
201
|
+
self.street = attributes[:'street']
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
if attributes.key?(:'subdistrict')
|
|
205
|
+
self.subdistrict = attributes[:'subdistrict']
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
if attributes.key?(:'village_town_city')
|
|
209
|
+
self.village_town_city = attributes[:'village_town_city']
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
214
|
+
# @return Array for valid properties with the reasons
|
|
215
|
+
def list_invalid_properties
|
|
216
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
217
|
+
invalid_properties = Array.new
|
|
218
|
+
invalid_properties
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Check to see if the all the properties in the model are valid
|
|
222
|
+
# @return true if the model is valid
|
|
223
|
+
def valid?
|
|
224
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
225
|
+
true
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Checks equality by comparing each attribute.
|
|
229
|
+
# @param [Object] Object to be compared
|
|
230
|
+
def ==(o)
|
|
231
|
+
return true if self.equal?(o)
|
|
232
|
+
self.class == o.class &&
|
|
233
|
+
name == o.name &&
|
|
234
|
+
date_of_birth == o.date_of_birth &&
|
|
235
|
+
gender == o.gender &&
|
|
236
|
+
care_of == o.care_of &&
|
|
237
|
+
country == o.country &&
|
|
238
|
+
district == o.district &&
|
|
239
|
+
house == o.house &&
|
|
240
|
+
location == o.location &&
|
|
241
|
+
landmark == o.landmark &&
|
|
242
|
+
postal_code == o.postal_code &&
|
|
243
|
+
post_office == o.post_office &&
|
|
244
|
+
state == o.state &&
|
|
245
|
+
street == o.street &&
|
|
246
|
+
subdistrict == o.subdistrict &&
|
|
247
|
+
village_town_city == o.village_town_city
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# @see the `==` method
|
|
251
|
+
# @param [Object] Object to be compared
|
|
252
|
+
def eql?(o)
|
|
253
|
+
self == o
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# Calculates hash code according to all attributes.
|
|
257
|
+
# @return [Integer] Hash code
|
|
258
|
+
def hash
|
|
259
|
+
[name, date_of_birth, gender, care_of, country, district, house, location, landmark, postal_code, post_office, state, street, subdistrict, village_town_city].hash
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# Builds the object from hash
|
|
263
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
264
|
+
# @return [Object] Returns the model itself
|
|
265
|
+
def self.build_from_hash(attributes)
|
|
266
|
+
return nil unless attributes.is_a?(Hash)
|
|
267
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
268
|
+
transformed_hash = {}
|
|
269
|
+
openapi_types.each_pair do |key, type|
|
|
270
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
271
|
+
transformed_hash["#{key}"] = nil
|
|
272
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
273
|
+
# check to ensure the input is an array given that the attribute
|
|
274
|
+
# is documented as an array but the input is not
|
|
275
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
276
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
277
|
+
end
|
|
278
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
279
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
280
|
+
end
|
|
281
|
+
end
|
|
282
|
+
new(transformed_hash)
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
# Deserializes the data based on type
|
|
286
|
+
# @param string type Data type
|
|
287
|
+
# @param string value Value to be deserialized
|
|
288
|
+
# @return [Object] Deserialized data
|
|
289
|
+
def self._deserialize(type, value)
|
|
290
|
+
case type.to_sym
|
|
291
|
+
when :Time
|
|
292
|
+
Time.parse(value)
|
|
293
|
+
when :Date
|
|
294
|
+
Date.parse(value)
|
|
295
|
+
when :String
|
|
296
|
+
value.to_s
|
|
297
|
+
when :Integer
|
|
298
|
+
value.to_i
|
|
299
|
+
when :Float
|
|
300
|
+
value.to_f
|
|
301
|
+
when :Boolean
|
|
302
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
303
|
+
true
|
|
304
|
+
else
|
|
305
|
+
false
|
|
306
|
+
end
|
|
307
|
+
when :Object
|
|
308
|
+
# generic object (usually a Hash), return directly
|
|
309
|
+
value
|
|
310
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
311
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
312
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
313
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
314
|
+
k_type = Regexp.last_match[:k_type]
|
|
315
|
+
v_type = Regexp.last_match[:v_type]
|
|
316
|
+
{}.tap do |hash|
|
|
317
|
+
value.each do |k, v|
|
|
318
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
319
|
+
end
|
|
320
|
+
end
|
|
321
|
+
else # model
|
|
322
|
+
# models (e.g. Pet) or oneOf
|
|
323
|
+
klass = TrinsicApi.const_get(type)
|
|
324
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
325
|
+
end
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
# Returns the string representation of the object
|
|
329
|
+
# @return [String] String presentation of the object
|
|
330
|
+
def to_s
|
|
331
|
+
to_hash.to_s
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
335
|
+
# @return [Hash] Returns the object in the form of hash
|
|
336
|
+
def to_body
|
|
337
|
+
to_hash
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
# Returns the object in the form of hash
|
|
341
|
+
# @return [Hash] Returns the object in the form of hash
|
|
342
|
+
def to_hash
|
|
343
|
+
hash = {}
|
|
344
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
345
|
+
value = self.send(attr)
|
|
346
|
+
if value.nil?
|
|
347
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
348
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
hash[param] = _to_hash(value)
|
|
352
|
+
end
|
|
353
|
+
hash
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
# Outputs non-array value in the form of hash
|
|
357
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
358
|
+
# @param [Object] value Any valid value
|
|
359
|
+
# @return [Hash] Returns the value in the form of hash
|
|
360
|
+
def _to_hash(value)
|
|
361
|
+
if value.is_a?(Array)
|
|
362
|
+
value.compact.map { |v| _to_hash(v) }
|
|
363
|
+
elsif value.is_a?(Hash)
|
|
364
|
+
{}.tap do |hash|
|
|
365
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
366
|
+
end
|
|
367
|
+
elsif value.respond_to? :to_hash
|
|
368
|
+
value.to_hash
|
|
369
|
+
else
|
|
370
|
+
value
|
|
371
|
+
end
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
end
|
|
375
|
+
|
|
376
|
+
end
|