trinsic_api 1.1.2 → 2.0.0.pre.alpha3

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 (183) hide show
  1. checksums.yaml +4 -4
  2. data/docs/AadhaarInput.md +20 -0
  3. data/docs/Address.md +3 -3
  4. data/docs/AttachmentAccessKeys.md +7 -5
  5. data/docs/BangladeshNationalIdInput.md +24 -0
  6. data/docs/BrazilCpfCheckInput.md +18 -0
  7. data/docs/BrazilDigitalCnhInput.md +24 -0
  8. data/docs/CreateAdvancedProviderSessionRequest.md +26 -0
  9. data/docs/CreateAdvancedProviderSessionResponse.md +22 -0
  10. data/docs/CreateHostedProviderSessionRequest.md +22 -0
  11. data/docs/CreateHostedProviderSessionResponse.md +20 -0
  12. data/docs/CreateWidgetSessionRequest.md +22 -0
  13. data/docs/{CreateSessionResponse.md → CreateWidgetSessionResponse.md} +5 -5
  14. data/docs/DocumentData.md +3 -3
  15. data/docs/DocumentScanAttachments.md +18 -0
  16. data/docs/{SessionState.md → DocumentType.md} +2 -2
  17. data/docs/HttpValidationProblemDetails.md +28 -0
  18. data/docs/IdentityData.md +4 -4
  19. data/docs/IndonesiaNikInput.md +22 -0
  20. data/docs/{FailureMessage.md → IntegrationCapability.md} +2 -5
  21. data/docs/IntegrationLaunchMethod.md +15 -0
  22. data/docs/IntegrationStep.md +22 -0
  23. data/docs/KenyaNidInput.md +28 -0
  24. data/docs/KnownAddress.md +32 -0
  25. data/docs/KnownIdentityData.md +18 -0
  26. data/docs/KnownPersonData.md +32 -0
  27. data/docs/MexicoCurpInput.md +18 -0
  28. data/docs/NetworkApi.md +37 -35
  29. data/docs/NigeriaNinInput.md +30 -0
  30. data/docs/PersonData.md +14 -12
  31. data/docs/PhilippineMatchInput.md +26 -0
  32. data/docs/PhilippineQRInput.md +20 -0
  33. data/docs/ProblemDetails.md +26 -0
  34. data/docs/ProviderAttachments.md +18 -0
  35. data/docs/ProviderInfo.md +3 -1
  36. data/docs/ProviderInformation.md +22 -0
  37. data/docs/ProviderInput.md +38 -0
  38. data/docs/RecommendRequest.md +26 -0
  39. data/docs/RecommendResponse.md +22 -0
  40. data/docs/RefreshStepContentRequest.md +18 -0
  41. data/docs/RefreshStepContentResponse.md +18 -0
  42. data/docs/ResultCollection.md +20 -0
  43. data/docs/ResultCollectionMethod.md +15 -0
  44. data/docs/Session.md +6 -8
  45. data/docs/{VerificationFailCode.md → SessionErrorCode.md} +2 -2
  46. data/docs/SessionsApi.md +236 -18
  47. data/docs/{SessionFailCode.md → Sex.md} +2 -2
  48. data/docs/SouthAfricaNidInput.md +24 -0
  49. data/docs/StepRefreshInfo.md +22 -0
  50. data/lib/trinsic_api/api/attachments_api.rb +1 -1
  51. data/lib/trinsic_api/api/network_api.rb +38 -37
  52. data/lib/trinsic_api/api/sessions_api.rb +217 -19
  53. data/lib/trinsic_api/api_client.rb +1 -1
  54. data/lib/trinsic_api/api_error.rb +1 -1
  55. data/lib/trinsic_api/configuration.rb +1 -1
  56. data/lib/trinsic_api/models/{validation_result.rb → aadhaar_input.rb} +21 -26
  57. data/lib/trinsic_api/models/address.rb +16 -10
  58. data/lib/trinsic_api/models/attachment_access_keys.rb +25 -10
  59. data/lib/trinsic_api/models/bangladesh_national_id_input.rb +249 -0
  60. data/lib/trinsic_api/models/brazil_cpf_check_input.rb +261 -0
  61. data/lib/trinsic_api/models/brazil_digital_cnh_input.rb +294 -0
  62. data/lib/trinsic_api/models/cancel_session_response.rb +1 -1
  63. data/lib/trinsic_api/models/create_advanced_provider_session_request.rb +312 -0
  64. data/lib/trinsic_api/models/create_advanced_provider_session_response.rb +256 -0
  65. data/lib/trinsic_api/models/create_hosted_provider_session_request.rb +288 -0
  66. data/lib/trinsic_api/models/create_hosted_provider_session_response.rb +233 -0
  67. data/lib/trinsic_api/models/create_widget_session_request.rb +240 -0
  68. data/lib/trinsic_api/models/{create_session_response.rb → create_widget_session_response.rb} +18 -17
  69. data/lib/trinsic_api/models/document_data.rb +32 -4
  70. data/lib/trinsic_api/models/{failure_message.rb → document_scan_attachments.rb} +12 -18
  71. data/lib/trinsic_api/models/{session_state.rb → document_type.rb} +9 -11
  72. data/lib/trinsic_api/models/get_attachment_request.rb +1 -1
  73. data/lib/trinsic_api/models/get_attachment_response.rb +1 -1
  74. data/lib/trinsic_api/models/get_session_response.rb +1 -1
  75. data/lib/trinsic_api/models/get_session_result_request.rb +1 -1
  76. data/lib/trinsic_api/models/get_session_result_response.rb +2 -1
  77. data/lib/trinsic_api/models/http_validation_problem_details.rb +273 -0
  78. data/lib/trinsic_api/models/identity_data.rb +5 -5
  79. data/lib/trinsic_api/models/{create_session_request.rb → indonesia_nik_input.rb} +105 -38
  80. data/lib/trinsic_api/models/integration_capability.rb +44 -0
  81. data/lib/trinsic_api/models/integration_launch_method.rb +42 -0
  82. data/lib/trinsic_api/models/integration_step.rb +275 -0
  83. data/lib/trinsic_api/models/kenya_nid_input.rb +397 -0
  84. data/lib/trinsic_api/models/known_address.rb +287 -0
  85. data/lib/trinsic_api/models/known_identity_data.rb +217 -0
  86. data/lib/trinsic_api/models/{disclosed_fields_request.rb → known_person_data.rb} +57 -77
  87. data/lib/trinsic_api/models/list_providers_response.rb +1 -1
  88. data/lib/trinsic_api/models/list_sessions_response.rb +1 -1
  89. data/lib/trinsic_api/models/mexico_curp_input.rb +250 -0
  90. data/lib/trinsic_api/models/nigeria_nin_input.rb +383 -0
  91. data/lib/trinsic_api/models/order_direction.rb +1 -1
  92. data/lib/trinsic_api/models/person_data.rb +50 -15
  93. data/lib/trinsic_api/models/philippine_match_input.rb +260 -0
  94. data/lib/trinsic_api/models/philippine_qr_input.rb +227 -0
  95. data/lib/trinsic_api/models/problem_details.rb +255 -0
  96. data/lib/trinsic_api/models/provider_attachments.rb +215 -0
  97. data/lib/trinsic_api/models/provider_info.rb +18 -5
  98. data/lib/trinsic_api/models/provider_information.rb +253 -0
  99. data/lib/trinsic_api/models/provider_input.rb +326 -0
  100. data/lib/trinsic_api/models/recommend_request.rb +266 -0
  101. data/lib/trinsic_api/models/recommend_response.rb +262 -0
  102. data/lib/trinsic_api/models/refresh_step_content_request.rb +216 -0
  103. data/lib/trinsic_api/models/{identity_lookup_response.rb → refresh_step_content_response.rb} +16 -16
  104. data/lib/trinsic_api/models/{verification.rb → result_collection.rb} +27 -20
  105. data/lib/trinsic_api/models/result_collection_method.rb +40 -0
  106. data/lib/trinsic_api/models/session.rb +32 -48
  107. data/lib/trinsic_api/models/session_error_code.rb +48 -0
  108. data/lib/trinsic_api/models/session_ordering.rb +1 -1
  109. data/lib/trinsic_api/models/sex.rb +42 -0
  110. data/lib/trinsic_api/models/{disclosed_fields.rb → south_africa_nid_input.rb} +107 -154
  111. data/lib/trinsic_api/models/step_refresh_info.rb +256 -0
  112. data/lib/trinsic_api/version.rb +2 -2
  113. data/lib/trinsic_api.rb +40 -12
  114. data/spec/api/attachments_api_spec.rb +1 -1
  115. data/spec/api/network_api_spec.rb +12 -12
  116. data/spec/api/sessions_api_spec.rb +44 -7
  117. data/spec/models/{verification_spec.rb → aadhaar_input_spec.rb} +9 -9
  118. data/spec/models/address_spec.rb +2 -2
  119. data/spec/models/attachment_access_keys_spec.rb +7 -1
  120. data/spec/models/bangladesh_national_id_input_spec.rb +54 -0
  121. data/spec/models/{identity_lookup_response_spec.rb → brazil_cpf_check_input_spec.rb} +8 -8
  122. data/spec/models/brazil_digital_cnh_input_spec.rb +54 -0
  123. data/spec/models/cancel_session_response_spec.rb +1 -1
  124. data/spec/models/create_advanced_provider_session_request_spec.rb +60 -0
  125. data/spec/models/create_advanced_provider_session_response_spec.rb +48 -0
  126. data/spec/models/create_hosted_provider_session_request_spec.rb +48 -0
  127. data/spec/models/create_hosted_provider_session_response_spec.rb +42 -0
  128. data/spec/models/create_widget_session_request_spec.rb +48 -0
  129. data/spec/models/{create_session_response_spec.rb → create_widget_session_response_spec.rb} +8 -8
  130. data/spec/models/document_data_spec.rb +1 -1
  131. data/spec/models/document_scan_attachments_spec.rb +36 -0
  132. data/spec/models/{session_state_spec.rb → document_type_spec.rb} +7 -7
  133. data/spec/models/get_attachment_request_spec.rb +1 -1
  134. data/spec/models/get_attachment_response_spec.rb +1 -1
  135. data/spec/models/get_session_response_spec.rb +1 -1
  136. data/spec/models/get_session_result_request_spec.rb +1 -1
  137. data/spec/models/get_session_result_response_spec.rb +1 -1
  138. data/spec/models/http_validation_problem_details_spec.rb +66 -0
  139. data/spec/models/identity_data_spec.rb +1 -1
  140. data/spec/models/indonesia_nik_input_spec.rb +48 -0
  141. data/spec/models/integration_capability_spec.rb +30 -0
  142. data/spec/models/integration_launch_method_spec.rb +30 -0
  143. data/spec/models/integration_step_spec.rb +48 -0
  144. data/spec/models/kenya_nid_input_spec.rb +66 -0
  145. data/spec/models/known_address_spec.rb +78 -0
  146. data/spec/models/known_identity_data_spec.rb +36 -0
  147. data/spec/models/{disclosed_fields_request_spec.rb → known_person_data_spec.rb} +13 -37
  148. data/spec/models/list_providers_response_spec.rb +1 -1
  149. data/spec/models/list_sessions_response_spec.rb +1 -1
  150. data/spec/models/{failure_message_spec.rb → mexico_curp_input_spec.rb} +8 -8
  151. data/spec/models/nigeria_nin_input_spec.rb +72 -0
  152. data/spec/models/order_direction_spec.rb +1 -1
  153. data/spec/models/person_data_spec.rb +8 -2
  154. data/spec/models/philippine_match_input_spec.rb +60 -0
  155. data/spec/models/philippine_qr_input_spec.rb +42 -0
  156. data/spec/models/problem_details_spec.rb +60 -0
  157. data/spec/models/provider_attachments_spec.rb +36 -0
  158. data/spec/models/provider_info_spec.rb +7 -1
  159. data/spec/models/provider_information_spec.rb +48 -0
  160. data/spec/models/{disclosed_fields_spec.rb → provider_input_spec.rb} +18 -24
  161. data/spec/models/recommend_request_spec.rb +60 -0
  162. data/spec/models/recommend_response_spec.rb +48 -0
  163. data/spec/models/refresh_step_content_request_spec.rb +36 -0
  164. data/spec/models/refresh_step_content_response_spec.rb +36 -0
  165. data/spec/models/result_collection_method_spec.rb +30 -0
  166. data/spec/models/{validation_result_spec.rb → result_collection_spec.rb} +9 -9
  167. data/spec/models/{verification_fail_code_spec.rb → session_error_code_spec.rb} +7 -7
  168. data/spec/models/session_ordering_spec.rb +1 -1
  169. data/spec/models/session_spec.rb +4 -10
  170. data/spec/models/{session_fail_code_spec.rb → sex_spec.rb} +7 -7
  171. data/spec/models/{create_session_request_spec.rb → south_africa_nid_input_spec.rb} +11 -11
  172. data/spec/models/step_refresh_info_spec.rb +48 -0
  173. data/spec/spec_helper.rb +1 -1
  174. data/trinsic_api.gemspec +1 -1
  175. metadata +173 -61
  176. data/docs/CreateSessionRequest.md +0 -24
  177. data/docs/DisclosedFields.md +0 -40
  178. data/docs/DisclosedFieldsRequest.md +0 -40
  179. data/docs/IdentityLookupResponse.md +0 -18
  180. data/docs/ValidationResult.md +0 -20
  181. data/docs/Verification.md +0 -20
  182. data/lib/trinsic_api/models/session_fail_code.rb +0 -45
  183. data/lib/trinsic_api/models/verification_fail_code.rb +0 -43
@@ -1,5 +1,5 @@
1
1
  =begin
2
- #Connect API
2
+ #Trinsic API
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
@@ -14,31 +14,49 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module TrinsicApi
17
- # Identity information for the individual being verified
18
17
  class PersonData
19
- # Given (first) name of the individual
20
18
  attr_accessor :given_name
21
19
 
22
- # Family (last) name of the individual
23
20
  attr_accessor :family_name
24
21
 
25
- # Middle name of the individual
26
22
  attr_accessor :middle_name
27
23
 
28
- # The individual's full name as a single string. Useful for names which do not fit into a \"first middle last\" structure.
29
24
  attr_accessor :full_name
30
25
 
26
+ attr_accessor :suffix
27
+
31
28
  attr_accessor :nationality
32
29
 
33
- attr_accessor :gender
30
+ attr_accessor :sex
34
31
 
35
32
  attr_accessor :phone_number
36
33
 
37
- # Address information for an individual
38
34
  attr_accessor :address
39
35
 
40
36
  attr_accessor :date_of_birth
41
37
 
38
+ class EnumAttributeValidator
39
+ attr_reader :datatype
40
+ attr_reader :allowable_values
41
+
42
+ def initialize(datatype, allowable_values)
43
+ @allowable_values = allowable_values.map do |value|
44
+ case datatype.to_s
45
+ when /Integer/i
46
+ value.to_i
47
+ when /Float/i
48
+ value.to_f
49
+ else
50
+ value
51
+ end
52
+ end
53
+ end
54
+
55
+ def valid?(value)
56
+ !value || allowable_values.include?(value)
57
+ end
58
+ end
59
+
42
60
  # Attribute mapping from ruby-style variable name to JSON key.
43
61
  def self.attribute_map
44
62
  {
@@ -46,8 +64,9 @@ module TrinsicApi
46
64
  :'family_name' => :'familyName',
47
65
  :'middle_name' => :'middleName',
48
66
  :'full_name' => :'fullName',
67
+ :'suffix' => :'suffix',
49
68
  :'nationality' => :'nationality',
50
- :'gender' => :'gender',
69
+ :'sex' => :'sex',
51
70
  :'phone_number' => :'phoneNumber',
52
71
  :'address' => :'address',
53
72
  :'date_of_birth' => :'dateOfBirth'
@@ -66,17 +85,28 @@ module TrinsicApi
66
85
  :'family_name' => :'String',
67
86
  :'middle_name' => :'String',
68
87
  :'full_name' => :'String',
88
+ :'suffix' => :'String',
69
89
  :'nationality' => :'String',
70
- :'gender' => :'String',
90
+ :'sex' => :'Sex',
71
91
  :'phone_number' => :'String',
72
92
  :'address' => :'Address',
73
- :'date_of_birth' => :'String'
93
+ :'date_of_birth' => :'Date'
74
94
  }
75
95
  end
76
96
 
77
97
  # List of attributes with nullable: true
78
98
  def self.openapi_nullable
79
99
  Set.new([
100
+ :'given_name',
101
+ :'family_name',
102
+ :'middle_name',
103
+ :'full_name',
104
+ :'suffix',
105
+ :'nationality',
106
+ :'sex',
107
+ :'phone_number',
108
+ :'address',
109
+ :'date_of_birth'
80
110
  ])
81
111
  end
82
112
 
@@ -111,12 +141,16 @@ module TrinsicApi
111
141
  self.full_name = attributes[:'full_name']
112
142
  end
113
143
 
144
+ if attributes.key?(:'suffix')
145
+ self.suffix = attributes[:'suffix']
146
+ end
147
+
114
148
  if attributes.key?(:'nationality')
115
149
  self.nationality = attributes[:'nationality']
116
150
  end
117
151
 
118
- if attributes.key?(:'gender')
119
- self.gender = attributes[:'gender']
152
+ if attributes.key?(:'sex')
153
+ self.sex = attributes[:'sex']
120
154
  end
121
155
 
122
156
  if attributes.key?(:'phone_number')
@@ -156,8 +190,9 @@ module TrinsicApi
156
190
  family_name == o.family_name &&
157
191
  middle_name == o.middle_name &&
158
192
  full_name == o.full_name &&
193
+ suffix == o.suffix &&
159
194
  nationality == o.nationality &&
160
- gender == o.gender &&
195
+ sex == o.sex &&
161
196
  phone_number == o.phone_number &&
162
197
  address == o.address &&
163
198
  date_of_birth == o.date_of_birth
@@ -172,7 +207,7 @@ module TrinsicApi
172
207
  # Calculates hash code according to all attributes.
173
208
  # @return [Integer] Hash code
174
209
  def hash
175
- [given_name, family_name, middle_name, full_name, nationality, gender, phone_number, address, date_of_birth].hash
210
+ [given_name, family_name, middle_name, full_name, suffix, nationality, sex, phone_number, address, date_of_birth].hash
176
211
  end
177
212
 
178
213
  # Builds the object from hash
@@ -0,0 +1,260 @@
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.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrinsicApi
17
+ class PhilippineMatchInput
18
+ # The user's given / first name
19
+ attr_accessor :given_name
20
+
21
+ # The user's middle name
22
+ attr_accessor :middle_name
23
+
24
+ # The user's family / last name
25
+ attr_accessor :family_name
26
+
27
+ # The user's name suffix
28
+ attr_accessor :suffix
29
+
30
+ # The user's date of birth, in `YYYY-MM-DD` format
31
+ attr_accessor :date_of_birth
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'given_name' => :'givenName',
37
+ :'middle_name' => :'middleName',
38
+ :'family_name' => :'familyName',
39
+ :'suffix' => :'suffix',
40
+ :'date_of_birth' => :'dateOfBirth'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'given_name' => :'String',
53
+ :'middle_name' => :'String',
54
+ :'family_name' => :'String',
55
+ :'suffix' => :'String',
56
+ :'date_of_birth' => :'Date'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ :'given_name',
64
+ :'middle_name',
65
+ :'family_name',
66
+ :'suffix',
67
+ :'date_of_birth'
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::PhilippineMatchInput` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::PhilippineMatchInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'given_name')
87
+ self.given_name = attributes[:'given_name']
88
+ end
89
+
90
+ if attributes.key?(:'middle_name')
91
+ self.middle_name = attributes[:'middle_name']
92
+ end
93
+
94
+ if attributes.key?(:'family_name')
95
+ self.family_name = attributes[:'family_name']
96
+ end
97
+
98
+ if attributes.key?(:'suffix')
99
+ self.suffix = attributes[:'suffix']
100
+ end
101
+
102
+ if attributes.key?(:'date_of_birth')
103
+ self.date_of_birth = attributes[:'date_of_birth']
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ warn '[DEPRECATED] the `valid?` method is obsolete'
119
+ true
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] Object to be compared
124
+ def ==(o)
125
+ return true if self.equal?(o)
126
+ self.class == o.class &&
127
+ given_name == o.given_name &&
128
+ middle_name == o.middle_name &&
129
+ family_name == o.family_name &&
130
+ suffix == o.suffix &&
131
+ date_of_birth == o.date_of_birth
132
+ end
133
+
134
+ # @see the `==` method
135
+ # @param [Object] Object to be compared
136
+ def eql?(o)
137
+ self == o
138
+ end
139
+
140
+ # Calculates hash code according to all attributes.
141
+ # @return [Integer] Hash code
142
+ def hash
143
+ [given_name, middle_name, family_name, suffix, date_of_birth].hash
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def self.build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ attributes = attributes.transform_keys(&:to_sym)
152
+ transformed_hash = {}
153
+ openapi_types.each_pair do |key, type|
154
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
155
+ transformed_hash["#{key}"] = nil
156
+ elsif type =~ /\AArray<(.*)>/i
157
+ # check to ensure the input is an array given that the attribute
158
+ # is documented as an array but the input is not
159
+ if attributes[attribute_map[key]].is_a?(Array)
160
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
161
+ end
162
+ elsif !attributes[attribute_map[key]].nil?
163
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
164
+ end
165
+ end
166
+ new(transformed_hash)
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def self._deserialize(type, value)
174
+ case type.to_sym
175
+ when :Time
176
+ Time.parse(value)
177
+ when :Date
178
+ Date.parse(value)
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :Boolean
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :Object
192
+ # generic object (usually a Hash), return directly
193
+ value
194
+ when /\AArray<(?<inner_type>.+)>\z/
195
+ inner_type = Regexp.last_match[:inner_type]
196
+ value.map { |v| _deserialize(inner_type, v) }
197
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
+ k_type = Regexp.last_match[:k_type]
199
+ v_type = Regexp.last_match[:v_type]
200
+ {}.tap do |hash|
201
+ value.each do |k, v|
202
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
+ end
204
+ end
205
+ else # model
206
+ # models (e.g. Pet) or oneOf
207
+ klass = TrinsicApi.const_get(type)
208
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
209
+ end
210
+ end
211
+
212
+ # Returns the string representation of the object
213
+ # @return [String] String presentation of the object
214
+ def to_s
215
+ to_hash.to_s
216
+ end
217
+
218
+ # to_body is an alias to to_hash (backward compatibility)
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_body
221
+ to_hash
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ # Outputs non-array value in the form of hash
241
+ # For object, use to_hash. Otherwise, just return the value
242
+ # @param [Object] value Any valid value
243
+ # @return [Hash] Returns the value in the form of hash
244
+ def _to_hash(value)
245
+ if value.is_a?(Array)
246
+ value.compact.map { |v| _to_hash(v) }
247
+ elsif value.is_a?(Hash)
248
+ {}.tap do |hash|
249
+ value.each { |k, v| hash[k] = _to_hash(v) }
250
+ end
251
+ elsif value.respond_to? :to_hash
252
+ value.to_hash
253
+ else
254
+ value
255
+ end
256
+ end
257
+
258
+ end
259
+
260
+ end
@@ -0,0 +1,227 @@
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.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrinsicApi
17
+ class PhilippineQRInput
18
+ # The raw text of the user's QR code after decoding it.
19
+ attr_accessor :qr_code_text
20
+
21
+ # The raw bytes of the image containing the user's QR code.
22
+ attr_accessor :qr_code_image
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'qr_code_text' => :'qrCodeText',
28
+ :'qr_code_image' => :'qrCodeImage'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'qr_code_text' => :'String',
41
+ :'qr_code_image' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ :'qr_code_text',
49
+ :'qr_code_image'
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::PhilippineQRInput` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::PhilippineQRInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'qr_code_text')
69
+ self.qr_code_text = attributes[:'qr_code_text']
70
+ end
71
+
72
+ if attributes.key?(:'qr_code_image')
73
+ self.qr_code_image = attributes[:'qr_code_image']
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
+ invalid_properties = Array.new
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ warn '[DEPRECATED] the `valid?` method is obsolete'
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ qr_code_text == o.qr_code_text &&
98
+ qr_code_image == o.qr_code_image
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(o)
104
+ self == o
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Integer] Hash code
109
+ def hash
110
+ [qr_code_text, qr_code_image].hash
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def self.build_from_hash(attributes)
117
+ return nil unless attributes.is_a?(Hash)
118
+ attributes = attributes.transform_keys(&:to_sym)
119
+ transformed_hash = {}
120
+ openapi_types.each_pair do |key, type|
121
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
122
+ transformed_hash["#{key}"] = nil
123
+ elsif type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[attribute_map[key]].is_a?(Array)
127
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
128
+ end
129
+ elsif !attributes[attribute_map[key]].nil?
130
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
131
+ end
132
+ end
133
+ new(transformed_hash)
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def self._deserialize(type, value)
141
+ case type.to_sym
142
+ when :Time
143
+ Time.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :Boolean
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ # models (e.g. Pet) or oneOf
174
+ klass = TrinsicApi.const_get(type)
175
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
176
+ end
177
+ end
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # to_body is an alias to to_hash (backward compatibility)
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_body
188
+ to_hash
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ if value.nil?
198
+ is_nullable = self.class.openapi_nullable.include?(attr)
199
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
200
+ end
201
+
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map { |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+
225
+ end
226
+
227
+ end