trinsic_api 2.0.2 → 2.1.0.pre.alpha1

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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/docs/AttachmentsApi.md +2 -2
  3. data/docs/BangladeshNidInput.md +26 -0
  4. data/docs/BrazilDigitalCnhInput.md +1 -1
  5. data/docs/ContractField.md +20 -0
  6. data/docs/CreateAdvancedProviderSessionRequest.md +3 -3
  7. data/docs/CreateHostedProviderSessionRequest.md +1 -1
  8. data/docs/FieldAvailability.md +15 -0
  9. data/docs/HttpValidationProblemDetails.md +5 -5
  10. data/docs/NetworkApi.md +14 -9
  11. data/docs/ProblemDetails.md +5 -5
  12. data/docs/ProviderContract.md +6 -2
  13. data/docs/ProviderInfo.md +9 -1
  14. data/docs/ProviderInformation.md +16 -4
  15. data/docs/ProviderInput.md +13 -13
  16. data/docs/RecommendRequest.md +3 -1
  17. data/docs/RecommendResponse.md +3 -3
  18. data/docs/RefreshStepContentRequest.md +1 -1
  19. data/docs/Session.md +1 -1
  20. data/docs/SessionsApi.md +13 -13
  21. data/docs/SmartIdInput.md +3 -1
  22. data/docs/SubProviderMetadata.md +4 -2
  23. data/lib/trinsic_api/api/attachments_api.rb +3 -3
  24. data/lib/trinsic_api/api/network_api.rb +8 -5
  25. data/lib/trinsic_api/api/sessions_api.rb +11 -11
  26. data/lib/trinsic_api/models/bangladesh_nid_input.rb +350 -0
  27. data/lib/trinsic_api/models/brazil_digital_cnh_input.rb +1 -1
  28. data/lib/trinsic_api/models/{bangladesh_national_id_input.rb → contract_field.rb} +69 -36
  29. data/lib/trinsic_api/models/create_advanced_provider_session_request.rb +16 -16
  30. data/lib/trinsic_api/models/create_hosted_provider_session_request.rb +1 -1
  31. data/lib/trinsic_api/models/document_type.rb +2 -1
  32. data/lib/trinsic_api/models/field_availability.rb +41 -0
  33. data/lib/trinsic_api/models/http_validation_problem_details.rb +5 -0
  34. data/lib/trinsic_api/models/integration_capability.rb +2 -1
  35. data/lib/trinsic_api/models/problem_details.rb +5 -0
  36. data/lib/trinsic_api/models/provider_contract.rb +42 -2
  37. data/lib/trinsic_api/models/provider_info.rb +98 -4
  38. data/lib/trinsic_api/models/provider_information.rb +155 -4
  39. data/lib/trinsic_api/models/provider_input.rb +13 -13
  40. data/lib/trinsic_api/models/recommend_request.rb +16 -5
  41. data/lib/trinsic_api/models/recommend_response.rb +3 -3
  42. data/lib/trinsic_api/models/refresh_step_content_request.rb +26 -1
  43. data/lib/trinsic_api/models/session.rb +1 -1
  44. data/lib/trinsic_api/models/smart_id_input.rb +16 -5
  45. data/lib/trinsic_api/models/sub_provider_metadata.rb +29 -2
  46. data/lib/trinsic_api/version.rb +1 -1
  47. data/lib/trinsic_api.rb +3 -2
  48. data/spec/api/attachments_api_spec.rb +1 -1
  49. data/spec/api/network_api_spec.rb +2 -1
  50. data/spec/api/sessions_api_spec.rb +1 -1
  51. data/spec/models/{bangladesh_national_id_input_spec.rb → bangladesh_nid_input_spec.rb} +13 -7
  52. data/spec/models/contract_field_spec.rb +42 -0
  53. data/spec/models/create_advanced_provider_session_request_spec.rb +4 -4
  54. data/spec/models/field_availability_spec.rb +30 -0
  55. data/spec/models/provider_contract_spec.rb +12 -0
  56. data/spec/models/provider_info_spec.rb +24 -0
  57. data/spec/models/provider_information_spec.rb +36 -0
  58. data/spec/models/recommend_request_spec.rb +6 -0
  59. data/spec/models/smart_id_input_spec.rb +6 -0
  60. data/spec/models/sub_provider_metadata_spec.rb +6 -0
  61. metadata +67 -63
  62. data/docs/BangladeshNationalIdInput.md +0 -24
  63. data/docs/WellKnownApi.md +0 -71
  64. data/lib/trinsic_api/api/well_known_api.rb +0 -75
  65. data/spec/api/well_known_api_spec.rb +0 -44
@@ -20,7 +20,7 @@ module TrinsicApi
20
20
  @api_client = api_client
21
21
  end
22
22
  # Get Attachment
23
- # Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
23
+ # Exchange an Attachment Access Key (from `IdentityData.AttachmentAccessKeys`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
24
24
  # @param [Hash] opts the optional parameters
25
25
  # @option opts [GetAttachmentRequest] :get_attachment_request
26
26
  # @return [GetAttachmentResponse]
@@ -30,7 +30,7 @@ module TrinsicApi
30
30
  end
31
31
 
32
32
  # Get Attachment
33
- # Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
33
+ # Exchange an Attachment Access Key (from `IdentityData.AttachmentAccessKeys`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
34
34
  # @param [Hash] opts the optional parameters
35
35
  # @option opts [GetAttachmentRequest] :get_attachment_request
36
36
  # @return [Array<(GetAttachmentResponse, Integer, Hash)>] GetAttachmentResponse data, response status code and response headers
@@ -47,7 +47,7 @@ module TrinsicApi
47
47
  # header parameters
48
48
  header_params = opts[:header_params] || {}
49
49
  # HTTP header 'Accept' (if needed)
50
- header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json']) unless header_params['Accept']
50
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/problem+json']) unless header_params['Accept']
51
51
  # HTTP header 'Content-Type'
52
52
  content_type = @api_client.select_header_content_type(['application/json', 'text/json', 'application/*+json'])
53
53
  if !content_type.nil?
@@ -45,7 +45,7 @@ module TrinsicApi
45
45
  # header parameters
46
46
  header_params = opts[:header_params] || {}
47
47
  # HTTP header 'Accept' (if needed)
48
- header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json']) unless header_params['Accept']
48
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/problem+json']) unless header_params['Accept']
49
49
 
50
50
  # form parameters
51
51
  form_params = opts[:form_params] || {}
@@ -79,6 +79,7 @@ module TrinsicApi
79
79
  # List Providers
80
80
  # List all identity providers available for use
81
81
  # @param [Hash] opts the optional parameters
82
+ # @option opts [String] :health Filter providers by health status. Valid values: \&quot;online\&quot;, \&quot;offline\&quot;, \&quot;all\&quot;. Defaults to \&quot;all\&quot;.
82
83
  # @return [ListProvidersResponse]
83
84
  def list_providers(opts = {})
84
85
  data, _status_code, _headers = list_providers_with_http_info(opts)
@@ -88,6 +89,7 @@ module TrinsicApi
88
89
  # List Providers
89
90
  # List all identity providers available for use
90
91
  # @param [Hash] opts the optional parameters
92
+ # @option opts [String] :health Filter providers by health status. Valid values: \&quot;online\&quot;, \&quot;offline\&quot;, \&quot;all\&quot;. Defaults to \&quot;all\&quot;.
91
93
  # @return [Array<(ListProvidersResponse, Integer, Hash)>] ListProvidersResponse data, response status code and response headers
92
94
  def list_providers_with_http_info(opts = {})
93
95
  if @api_client.config.debugging
@@ -98,11 +100,12 @@ module TrinsicApi
98
100
 
99
101
  # query parameters
100
102
  query_params = opts[:query_params] || {}
103
+ query_params[:'health'] = opts[:'health'] if !opts[:'health'].nil?
101
104
 
102
105
  # header parameters
103
106
  header_params = opts[:header_params] || {}
104
107
  # HTTP header 'Accept' (if needed)
105
- header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json']) unless header_params['Accept']
108
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/problem+json']) unless header_params['Accept']
106
109
 
107
110
  # form parameters
108
111
  form_params = opts[:form_params] || {}
@@ -134,7 +137,7 @@ module TrinsicApi
134
137
  end
135
138
 
136
139
  # Recommend Providers
137
- # Generate provider recommendations based on the given signals (phone number, countries, states).
140
+ # Generate provider recommendations based on signals about the user's location (phone number, countries, states).
138
141
  # @param [Hash] opts the optional parameters
139
142
  # @option opts [RecommendRequest] :recommend_request
140
143
  # @return [RecommendResponse]
@@ -144,7 +147,7 @@ module TrinsicApi
144
147
  end
145
148
 
146
149
  # Recommend Providers
147
- # Generate provider recommendations based on the given signals (phone number, countries, states).
150
+ # Generate provider recommendations based on signals about the user&#39;s location (phone number, countries, states).
148
151
  # @param [Hash] opts the optional parameters
149
152
  # @option opts [RecommendRequest] :recommend_request
150
153
  # @return [Array<(RecommendResponse, Integer, Hash)>] RecommendResponse data, response status code and response headers
@@ -161,7 +164,7 @@ module TrinsicApi
161
164
  # header parameters
162
165
  header_params = opts[:header_params] || {}
163
166
  # HTTP header 'Accept' (if needed)
164
- header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json']) unless header_params['Accept']
167
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/problem+json']) unless header_params['Accept']
165
168
  # HTTP header 'Content-Type'
166
169
  content_type = @api_client.select_header_content_type(['application/json', 'text/json', 'application/*+json'])
167
170
  if !content_type.nil?
@@ -51,7 +51,7 @@ module TrinsicApi
51
51
  # header parameters
52
52
  header_params = opts[:header_params] || {}
53
53
  # HTTP header 'Accept' (if needed)
54
- header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json']) unless header_params['Accept']
54
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/problem+json']) unless header_params['Accept']
55
55
 
56
56
  # form parameters
57
57
  form_params = opts[:form_params] || {}
@@ -110,7 +110,7 @@ module TrinsicApi
110
110
  # header parameters
111
111
  header_params = opts[:header_params] || {}
112
112
  # HTTP header 'Accept' (if needed)
113
- header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json']) unless header_params['Accept']
113
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/problem+json']) unless header_params['Accept']
114
114
  # HTTP header 'Content-Type'
115
115
  content_type = @api_client.select_header_content_type(['application/json', 'text/json', 'application/*+json'])
116
116
  if !content_type.nil?
@@ -174,7 +174,7 @@ module TrinsicApi
174
174
  # header parameters
175
175
  header_params = opts[:header_params] || {}
176
176
  # HTTP header 'Accept' (if needed)
177
- header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json']) unless header_params['Accept']
177
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/problem+json']) unless header_params['Accept']
178
178
  # HTTP header 'Content-Type'
179
179
  content_type = @api_client.select_header_content_type(['application/json', 'text/json', 'application/*+json'])
180
180
  if !content_type.nil?
@@ -238,7 +238,7 @@ module TrinsicApi
238
238
  # header parameters
239
239
  header_params = opts[:header_params] || {}
240
240
  # HTTP header 'Accept' (if needed)
241
- header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json']) unless header_params['Accept']
241
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/problem+json']) unless header_params['Accept']
242
242
  # HTTP header 'Content-Type'
243
243
  content_type = @api_client.select_header_content_type(['application/json', 'text/json', 'application/*+json'])
244
244
  if !content_type.nil?
@@ -306,7 +306,7 @@ module TrinsicApi
306
306
  # header parameters
307
307
  header_params = opts[:header_params] || {}
308
308
  # HTTP header 'Accept' (if needed)
309
- header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json']) unless header_params['Accept']
309
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/problem+json']) unless header_params['Accept']
310
310
 
311
311
  # form parameters
312
312
  form_params = opts[:form_params] || {}
@@ -369,7 +369,7 @@ module TrinsicApi
369
369
  # header parameters
370
370
  header_params = opts[:header_params] || {}
371
371
  # HTTP header 'Accept' (if needed)
372
- header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json']) unless header_params['Accept']
372
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/problem+json']) unless header_params['Accept']
373
373
  # HTTP header 'Content-Type'
374
374
  content_type = @api_client.select_header_content_type(['application/json', 'text/json', 'application/*+json'])
375
375
  if !content_type.nil?
@@ -459,7 +459,7 @@ module TrinsicApi
459
459
  # header parameters
460
460
  header_params = opts[:header_params] || {}
461
461
  # HTTP header 'Accept' (if needed)
462
- header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json']) unless header_params['Accept']
462
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/problem+json']) unless header_params['Accept']
463
463
 
464
464
  # form parameters
465
465
  form_params = opts[:form_params] || {}
@@ -491,7 +491,7 @@ module TrinsicApi
491
491
  end
492
492
 
493
493
  # Redact Session
494
- # Redact a Session, removing all identity data from Trinsic's servers. Every application has a redaction period that dictates how long we will hold on to your users' PII data. Once a session falls outside the redaction cutoff date, all PII will automatically be removed from that session. You can utilize this endpoint to redact a session immediately. Identity data that a user has chosen to save in their passkey-protected wallet will not be deleted.
494
+ # Redact a Session, removing all identity data from Trinsic's servers. Every application has a redaction period that dictates how long we will hold on to your users' PII data. Once a session falls outside the redaction cutoff date, all PII will automatically be removed from that session. You can utilize this endpoint to redact a session immediately.
495
495
  # @param session_id [String]
496
496
  # @param [Hash] opts the optional parameters
497
497
  # @return [nil]
@@ -501,7 +501,7 @@ module TrinsicApi
501
501
  end
502
502
 
503
503
  # Redact Session
504
- # Redact a Session, removing all identity data from Trinsic&#39;s servers. Every application has a redaction period that dictates how long we will hold on to your users&#39; PII data. Once a session falls outside the redaction cutoff date, all PII will automatically be removed from that session. You can utilize this endpoint to redact a session immediately. Identity data that a user has chosen to save in their passkey-protected wallet will not be deleted.
504
+ # Redact a Session, removing all identity data from Trinsic&#39;s servers. Every application has a redaction period that dictates how long we will hold on to your users&#39; PII data. Once a session falls outside the redaction cutoff date, all PII will automatically be removed from that session. You can utilize this endpoint to redact a session immediately.
505
505
  # @param session_id [String]
506
506
  # @param [Hash] opts the optional parameters
507
507
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
@@ -522,7 +522,7 @@ module TrinsicApi
522
522
  # header parameters
523
523
  header_params = opts[:header_params] || {}
524
524
  # HTTP header 'Accept' (if needed)
525
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
525
+ header_params['Accept'] = @api_client.select_header_accept(['application/problem+json']) unless header_params['Accept']
526
526
 
527
527
  # form parameters
528
528
  form_params = opts[:form_params] || {}
@@ -587,7 +587,7 @@ module TrinsicApi
587
587
  # header parameters
588
588
  header_params = opts[:header_params] || {}
589
589
  # HTTP header 'Accept' (if needed)
590
- header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json']) unless header_params['Accept']
590
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/problem+json']) unless header_params['Accept']
591
591
  # HTTP header 'Content-Type'
592
592
  content_type = @api_client.select_header_content_type(['application/json', 'text/json', 'application/*+json'])
593
593
  if !content_type.nil?
@@ -0,0 +1,350 @@
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 BangladeshNidInput
18
+ # The user's Bangladesh National ID number.
19
+ attr_accessor :national_id_number
20
+
21
+ # The user's date of birth, in `YYYY-MM-DD` format
22
+ attr_accessor :date_of_birth
23
+
24
+ # The user's full name
25
+ attr_accessor :name
26
+
27
+ # The raw bytes of the photo file collected from the user.
28
+ attr_accessor :photo_byes
29
+
30
+ # The MIME Type of the file contained in `PhotoByes`. Must be one of `image/jpeg`, or `image/png`.
31
+ attr_accessor :photo_image_mime_type
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'national_id_number' => :'nationalIdNumber',
37
+ :'date_of_birth' => :'dateOfBirth',
38
+ :'name' => :'name',
39
+ :'photo_byes' => :'photoByes',
40
+ :'photo_image_mime_type' => :'photoImageMimeType'
41
+ }
42
+ end
43
+
44
+ # Returns attribute mapping this model knows about
45
+ def self.acceptable_attribute_map
46
+ attribute_map
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ acceptable_attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'national_id_number' => :'String',
58
+ :'date_of_birth' => :'Date',
59
+ :'name' => :'String',
60
+ :'photo_byes' => :'String',
61
+ :'photo_image_mime_type' => :'String'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ :'photo_byes',
69
+ :'photo_image_mime_type'
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::BangladeshNidInput` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ acceptable_attribute_map = self.class.acceptable_attribute_map
82
+ attributes = attributes.each_with_object({}) { |(k, v), h|
83
+ if (!acceptable_attribute_map.key?(k.to_sym))
84
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::BangladeshNidInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
85
+ end
86
+ h[k.to_sym] = v
87
+ }
88
+
89
+ if attributes.key?(:'national_id_number')
90
+ self.national_id_number = attributes[:'national_id_number']
91
+ else
92
+ self.national_id_number = nil
93
+ end
94
+
95
+ if attributes.key?(:'date_of_birth')
96
+ self.date_of_birth = attributes[:'date_of_birth']
97
+ else
98
+ self.date_of_birth = nil
99
+ end
100
+
101
+ if attributes.key?(:'name')
102
+ self.name = attributes[:'name']
103
+ else
104
+ self.name = nil
105
+ end
106
+
107
+ if attributes.key?(:'photo_byes')
108
+ self.photo_byes = attributes[:'photo_byes']
109
+ end
110
+
111
+ if attributes.key?(:'photo_image_mime_type')
112
+ self.photo_image_mime_type = attributes[:'photo_image_mime_type']
113
+ end
114
+ end
115
+
116
+ # Show invalid properties with the reasons. Usually used together with valid?
117
+ # @return Array for valid properties with the reasons
118
+ def list_invalid_properties
119
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
120
+ invalid_properties = Array.new
121
+ if @national_id_number.nil?
122
+ invalid_properties.push('invalid value for "national_id_number", national_id_number cannot be nil.')
123
+ end
124
+
125
+ if @national_id_number.to_s.length > 17
126
+ invalid_properties.push('invalid value for "national_id_number", the character length must be smaller than or equal to 17.')
127
+ end
128
+
129
+ if @national_id_number.to_s.length < 10
130
+ invalid_properties.push('invalid value for "national_id_number", the character length must be great than or equal to 10.')
131
+ end
132
+
133
+ if @date_of_birth.nil?
134
+ invalid_properties.push('invalid value for "date_of_birth", date_of_birth cannot be nil.')
135
+ end
136
+
137
+ if @name.nil?
138
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
139
+ end
140
+
141
+ if @name.to_s.length > 80
142
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 80.')
143
+ end
144
+
145
+ if @name.to_s.length < 1
146
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
147
+ end
148
+
149
+ invalid_properties
150
+ end
151
+
152
+ # Check to see if the all the properties in the model are valid
153
+ # @return true if the model is valid
154
+ def valid?
155
+ warn '[DEPRECATED] the `valid?` method is obsolete'
156
+ return false if @national_id_number.nil?
157
+ return false if @national_id_number.to_s.length > 17
158
+ return false if @national_id_number.to_s.length < 10
159
+ return false if @date_of_birth.nil?
160
+ return false if @name.nil?
161
+ return false if @name.to_s.length > 80
162
+ return false if @name.to_s.length < 1
163
+ true
164
+ end
165
+
166
+ # Custom attribute writer method with validation
167
+ # @param [Object] national_id_number Value to be assigned
168
+ def national_id_number=(national_id_number)
169
+ if national_id_number.nil?
170
+ fail ArgumentError, 'national_id_number cannot be nil'
171
+ end
172
+
173
+ if national_id_number.to_s.length > 17
174
+ fail ArgumentError, 'invalid value for "national_id_number", the character length must be smaller than or equal to 17.'
175
+ end
176
+
177
+ if national_id_number.to_s.length < 10
178
+ fail ArgumentError, 'invalid value for "national_id_number", the character length must be great than or equal to 10.'
179
+ end
180
+
181
+ @national_id_number = national_id_number
182
+ end
183
+
184
+ # Custom attribute writer method with validation
185
+ # @param [Object] date_of_birth Value to be assigned
186
+ def date_of_birth=(date_of_birth)
187
+ if date_of_birth.nil?
188
+ fail ArgumentError, 'date_of_birth cannot be nil'
189
+ end
190
+
191
+ @date_of_birth = date_of_birth
192
+ end
193
+
194
+ # Custom attribute writer method with validation
195
+ # @param [Object] name Value to be assigned
196
+ def name=(name)
197
+ if name.nil?
198
+ fail ArgumentError, 'name cannot be nil'
199
+ end
200
+
201
+ if name.to_s.length > 80
202
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 80.'
203
+ end
204
+
205
+ if name.to_s.length < 1
206
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
207
+ end
208
+
209
+ @name = name
210
+ end
211
+
212
+ # Checks equality by comparing each attribute.
213
+ # @param [Object] Object to be compared
214
+ def ==(o)
215
+ return true if self.equal?(o)
216
+ self.class == o.class &&
217
+ national_id_number == o.national_id_number &&
218
+ date_of_birth == o.date_of_birth &&
219
+ name == o.name &&
220
+ photo_byes == o.photo_byes &&
221
+ photo_image_mime_type == o.photo_image_mime_type
222
+ end
223
+
224
+ # @see the `==` method
225
+ # @param [Object] Object to be compared
226
+ def eql?(o)
227
+ self == o
228
+ end
229
+
230
+ # Calculates hash code according to all attributes.
231
+ # @return [Integer] Hash code
232
+ def hash
233
+ [national_id_number, date_of_birth, name, photo_byes, photo_image_mime_type].hash
234
+ end
235
+
236
+ # Builds the object from hash
237
+ # @param [Hash] attributes Model attributes in the form of hash
238
+ # @return [Object] Returns the model itself
239
+ def self.build_from_hash(attributes)
240
+ return nil unless attributes.is_a?(Hash)
241
+ attributes = attributes.transform_keys(&:to_sym)
242
+ transformed_hash = {}
243
+ openapi_types.each_pair do |key, type|
244
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
245
+ transformed_hash["#{key}"] = nil
246
+ elsif type =~ /\AArray<(.*)>/i
247
+ # check to ensure the input is an array given that the attribute
248
+ # is documented as an array but the input is not
249
+ if attributes[attribute_map[key]].is_a?(Array)
250
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
251
+ end
252
+ elsif !attributes[attribute_map[key]].nil?
253
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
254
+ end
255
+ end
256
+ new(transformed_hash)
257
+ end
258
+
259
+ # Deserializes the data based on type
260
+ # @param string type Data type
261
+ # @param string value Value to be deserialized
262
+ # @return [Object] Deserialized data
263
+ def self._deserialize(type, value)
264
+ case type.to_sym
265
+ when :Time
266
+ Time.parse(value)
267
+ when :Date
268
+ Date.parse(value)
269
+ when :String
270
+ value.to_s
271
+ when :Integer
272
+ value.to_i
273
+ when :Float
274
+ value.to_f
275
+ when :Boolean
276
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
277
+ true
278
+ else
279
+ false
280
+ end
281
+ when :Object
282
+ # generic object (usually a Hash), return directly
283
+ value
284
+ when /\AArray<(?<inner_type>.+)>\z/
285
+ inner_type = Regexp.last_match[:inner_type]
286
+ value.map { |v| _deserialize(inner_type, v) }
287
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
288
+ k_type = Regexp.last_match[:k_type]
289
+ v_type = Regexp.last_match[:v_type]
290
+ {}.tap do |hash|
291
+ value.each do |k, v|
292
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
293
+ end
294
+ end
295
+ else # model
296
+ # models (e.g. Pet) or oneOf
297
+ klass = TrinsicApi.const_get(type)
298
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
299
+ end
300
+ end
301
+
302
+ # Returns the string representation of the object
303
+ # @return [String] String presentation of the object
304
+ def to_s
305
+ to_hash.to_s
306
+ end
307
+
308
+ # to_body is an alias to to_hash (backward compatibility)
309
+ # @return [Hash] Returns the object in the form of hash
310
+ def to_body
311
+ to_hash
312
+ end
313
+
314
+ # Returns the object in the form of hash
315
+ # @return [Hash] Returns the object in the form of hash
316
+ def to_hash
317
+ hash = {}
318
+ self.class.attribute_map.each_pair do |attr, param|
319
+ value = self.send(attr)
320
+ if value.nil?
321
+ is_nullable = self.class.openapi_nullable.include?(attr)
322
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
323
+ end
324
+
325
+ hash[param] = _to_hash(value)
326
+ end
327
+ hash
328
+ end
329
+
330
+ # Outputs non-array value in the form of hash
331
+ # For object, use to_hash. Otherwise, just return the value
332
+ # @param [Object] value Any valid value
333
+ # @return [Hash] Returns the value in the form of hash
334
+ def _to_hash(value)
335
+ if value.is_a?(Array)
336
+ value.compact.map { |v| _to_hash(v) }
337
+ elsif value.is_a?(Hash)
338
+ {}.tap do |hash|
339
+ value.each { |k, v| hash[k] = _to_hash(v) }
340
+ end
341
+ elsif value.respond_to? :to_hash
342
+ value.to_hash
343
+ else
344
+ value
345
+ end
346
+ end
347
+
348
+ end
349
+
350
+ end
@@ -18,7 +18,7 @@ module TrinsicApi
18
18
  # The user's 11-digit, numeric CPF Number
19
19
  attr_accessor :cpf_number
20
20
 
21
- # The raw bytes of the digital CNH file collected from the user. TODO: Lucas or JP help me describe these below vvvvvvvv This can be: - An image containing a physical or digital QR code - A PDF file exported from the CNH app - Some scary third thing?
21
+ # The raw bytes of the digital CNH file collected from the user.
22
22
  attr_accessor :digital_cnh_file
23
23
 
24
24
  # The MIME Type of the file contained in `DigitalCnhFile`. Must be one of `application/pdf`, `image/jpeg`, or `image/png`.