onfido 5.1.1 → 5.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11bed99ce3f8728f3f344682bf2bd77fc5a24c02ee28fb0ba498e62b338ec0ba
4
- data.tar.gz: 101c8c0b12326edc85a44f6ffdfa6803e25b88c01392d99715dae7d188cb8579
3
+ metadata.gz: 89d4e3b1ff4f2b746cd887bf6c5851d871ddab48f848c02c2e321d168e8124bf
4
+ data.tar.gz: 8e7d37918c9e9751113dd8e390e69cc92e7e5847bd48cc8426e5084a32fecfb8
5
5
  SHA512:
6
- metadata.gz: 0106e4ca114ac27bf511ac9b77544ec999b2eaf464811f6ecbda7e40a3e36dd9c458b5a498873c1051eff7bda2781b3f328681874c357c576f5ec727631f1b98
7
- data.tar.gz: 65fcb7074155ef64bbbf581fa53f342607d17375e169703231d4353f7f59ea3c00693c64480aa1bc74cbc71d4b9ba9e891551b7be694e909c71cf4b98ee66516
6
+ metadata.gz: d60100dd4e03fe9cdc6cf890251940c5a532c94bbf059cfd3e7669f3cb348388ef2757c116d7720fdb568c32630c9a08a41598dfc48a84591c74e6a57b5cb810
7
+ data.tar.gz: d7bddea0dcbcc52d7afd6467aed32e0dc3c7ce062f7acd5dd5947481ed8e7d0506c68a918e48c50379337894f93c0f699eefbe24fbbfdb29d91bea71f9d5ae60
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## v5.2.0 5th June 2025
4
+
5
+ - Release based on Onfido OpenAPI spec version [v5.2.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v5.2.0):
6
+ - [BIO-7260] Add report configuration (including use_case) to checks
7
+
8
+ ## v5.1.1 19th May 2025
9
+
10
+ - Release based on Onfido OpenAPI spec version [v5.1.1](https://github.com/onfido/onfido-openapi-spec/releases/tag/v5.1.1):
11
+ - [CAT-1952] Fix corruption in file download
12
+
3
13
  ## v5.1.0 14th May 2025
4
14
 
5
15
  - Release based on Onfido OpenAPI spec version [v5.1.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v5.1.0):
@@ -11,6 +21,8 @@
11
21
  - Fix storage of device_fingerprint_reuse breakdown and properties as float
12
22
  - Add .markdownlint.json to templates
13
23
 
24
+ **DEPRECATION NOTICE**: This release has been **deprecated** in favour of [v5.1.1](#v511-19th-may-2025).
25
+
14
26
  ## v5.0.0 21st February 2025
15
27
 
16
28
  - Release based on Onfido OpenAPI spec version [v5.0.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v5.0.0):
@@ -27,6 +39,8 @@
27
39
  - Add tests for Download NFC Face endpoint
28
40
  - [Migration Guide](MIGRATION.md#upgrading-from-4x-to-5x)
29
41
 
42
+ **DEPRECATION NOTICE**: This release has been **deprecated** in favour of [v5.1.1](#v511-19th-may-2025).
43
+
30
44
  ## v4.6.0 24th January 2025
31
45
 
32
46
  - Release based on Onfido OpenAPI spec version [v4.6.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v4.6.0):
@@ -36,33 +50,45 @@
36
50
  - Add customer_user_id in the webhook event resource
37
51
  - test: wait for evidence folder to be available
38
52
 
53
+ **DEPRECATION NOTICE**: This release has been **deprecated** in favour of [v5.1.1](#v511-19th-may-2025).
54
+
39
55
  ## v4.5.0 8th January 2025
40
56
 
41
57
  - Release based on Onfido OpenAPI spec version [v4.5.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v4.5.0):
42
58
  - [STUDIO-4305] Add download evidence folder path
43
59
 
60
+ **DEPRECATION NOTICE**: This release has been **deprecated** in favour of [v5.1.1](#v511-19th-may-2025).
61
+
44
62
  ## v4.4.0 20th December 2024
45
63
 
46
64
  - Release based on Onfido OpenAPI spec version [v4.4.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v4.4.0):
47
65
  - [CAT-1593] Fix missing webhook type and evidence folder webhook
48
66
  - [CAT-1590] Allow any type for the workflow task output
49
67
 
68
+ **DEPRECATION NOTICE**: This release has been **deprecated** in favour of [v5.1.1](#v511-19th-may-2025).
69
+
50
70
  ## v4.3.0 27th November 2024
51
71
 
52
72
  - Release based on Onfido OpenAPI spec version [v4.3.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v4.3.0):
53
73
  - [CAT-1581] Revert "[CAT-1528] Fix barcode field in document properties object"
54
74
 
75
+ **DEPRECATION NOTICE**: This release has been **deprecated** in favour of [v5.1.1](#v511-19th-may-2025).
76
+
55
77
  ## v4.2.0 19th November 2024
56
78
 
57
79
  - Release based on Onfido OpenAPI spec version [v4.2.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v4.2.0):
58
80
  - feat: add new fields to facial similarity report objects
59
81
  - [CAT-1552] Add missing document types
60
82
 
83
+ **DEPRECATION NOTICE**: This release has been **deprecated** in favour of [v5.1.1](#v511-19th-may-2025).
84
+
61
85
  ## v4.1.0 8th November 2024
62
86
 
63
87
  - Release based on Onfido OpenAPI spec version [v4.1.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v4.1.0):
64
88
  - [CAT-1528] Fix barcode field in document properties object
65
89
 
90
+ **DEPRECATION NOTICE**: This release has been **deprecated** in favour of [v5.1.1](#v511-19th-may-2025).
91
+
66
92
  ## v4.0.0 24th October 2024
67
93
 
68
94
  - Release based on Onfido OpenAPI spec version [v4.0.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v4.0.0):
@@ -74,6 +100,8 @@
74
100
  - Upgrade OpenAPI generator to v7.9.0 (was v7.6.0)
75
101
  - [Migration Guide](MIGRATION.md#upgrading-from-3x-to-4x)
76
102
 
103
+ **DEPRECATION NOTICE**: This release has been **deprecated** in favour of [v5.1.1](#v511-19th-may-2025).
104
+
77
105
  ## v3.4.0 20th September 2024
78
106
 
79
107
  - Release based on Onfido OpenAPI spec version [v3.5.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v3.5.0):
data/README.md CHANGED
@@ -14,7 +14,7 @@ This version uses Onfido API v3.6. Refer to our [API versioning guide](https://d
14
14
  ### Installation
15
15
 
16
16
  ```ruby
17
- gem 'onfido', '~> 5.1.1'
17
+ gem 'onfido', '~> 5.3.0'
18
18
  ```
19
19
 
20
20
  Configure with your API token, region and optional timeout (default value is 30):
@@ -35,7 +35,7 @@ module Onfido
35
35
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
36
36
  def initialize(config = Configuration.default)
37
37
  @config = config
38
- @user_agent = "onfido-ruby/5.1.1"
38
+ @user_agent = "onfido-ruby/5.3.0"
39
39
  @default_headers = {
40
40
  'Content-Type' => 'application/json',
41
41
  'User-Agent' => @user_agent
@@ -52,6 +52,8 @@ module Onfido
52
52
 
53
53
  attr_accessor :us_driving_licence
54
54
 
55
+ attr_accessor :report_configuration
56
+
55
57
  # Attribute mapping from ruby-style variable name to JSON key.
56
58
  def self.attribute_map
57
59
  {
@@ -67,7 +69,8 @@ module Onfido
67
69
  :'suppress_form_emails' => :'suppress_form_emails',
68
70
  :'sub_result' => :'sub_result',
69
71
  :'consider' => :'consider',
70
- :'us_driving_licence' => :'us_driving_licence'
72
+ :'us_driving_licence' => :'us_driving_licence',
73
+ :'report_configuration' => :'report_configuration'
71
74
  }
72
75
  end
73
76
 
@@ -91,7 +94,8 @@ module Onfido
91
94
  :'suppress_form_emails' => :'Boolean',
92
95
  :'sub_result' => :'String',
93
96
  :'consider' => :'Array<ReportName>',
94
- :'us_driving_licence' => :'UsDrivingLicenceBuilder'
97
+ :'us_driving_licence' => :'UsDrivingLicenceBuilder',
98
+ :'report_configuration' => :'ReportConfiguration'
95
99
  }
96
100
  end
97
101
 
@@ -193,6 +197,10 @@ module Onfido
193
197
  if attributes.key?(:'us_driving_licence')
194
198
  self.us_driving_licence = attributes[:'us_driving_licence']
195
199
  end
200
+
201
+ if attributes.key?(:'report_configuration')
202
+ self.report_configuration = attributes[:'report_configuration']
203
+ end
196
204
  end
197
205
 
198
206
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -237,7 +245,8 @@ module Onfido
237
245
  suppress_form_emails == o.suppress_form_emails &&
238
246
  sub_result == o.sub_result &&
239
247
  consider == o.consider &&
240
- us_driving_licence == o.us_driving_licence
248
+ us_driving_licence == o.us_driving_licence &&
249
+ report_configuration == o.report_configuration
241
250
  end
242
251
 
243
252
  # @see the `==` method
@@ -249,7 +258,7 @@ module Onfido
249
258
  # Calculates hash code according to all attributes.
250
259
  # @return [Integer] Hash code
251
260
  def hash
252
- [webhook_ids, applicant_id, applicant_provides_data, tags, redirect_uri, privacy_notices_read_consent_given, report_names, document_ids, asynchronous, suppress_form_emails, sub_result, consider, us_driving_licence].hash
261
+ [webhook_ids, applicant_id, applicant_provides_data, tags, redirect_uri, privacy_notices_read_consent_given, report_names, document_ids, asynchronous, suppress_form_emails, sub_result, consider, us_driving_licence, report_configuration].hash
253
262
  end
254
263
 
255
264
  # Builds the object from hash
@@ -38,6 +38,8 @@ module Onfido
38
38
 
39
39
  attr_accessor :us_driving_licence
40
40
 
41
+ attr_accessor :report_configuration
42
+
41
43
  # Attribute mapping from ruby-style variable name to JSON key.
42
44
  def self.attribute_map
43
45
  {
@@ -48,7 +50,8 @@ module Onfido
48
50
  :'suppress_form_emails' => :'suppress_form_emails',
49
51
  :'sub_result' => :'sub_result',
50
52
  :'consider' => :'consider',
51
- :'us_driving_licence' => :'us_driving_licence'
53
+ :'us_driving_licence' => :'us_driving_licence',
54
+ :'report_configuration' => :'report_configuration'
52
55
  }
53
56
  end
54
57
 
@@ -67,7 +70,8 @@ module Onfido
67
70
  :'suppress_form_emails' => :'Boolean',
68
71
  :'sub_result' => :'String',
69
72
  :'consider' => :'Array<ReportName>',
70
- :'us_driving_licence' => :'UsDrivingLicenceBuilder'
73
+ :'us_driving_licence' => :'UsDrivingLicenceBuilder',
74
+ :'report_configuration' => :'ReportConfiguration'
71
75
  }
72
76
  end
73
77
 
@@ -135,6 +139,10 @@ module Onfido
135
139
  if attributes.key?(:'us_driving_licence')
136
140
  self.us_driving_licence = attributes[:'us_driving_licence']
137
141
  end
142
+
143
+ if attributes.key?(:'report_configuration')
144
+ self.report_configuration = attributes[:'report_configuration']
145
+ end
138
146
  end
139
147
 
140
148
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -169,7 +177,8 @@ module Onfido
169
177
  suppress_form_emails == o.suppress_form_emails &&
170
178
  sub_result == o.sub_result &&
171
179
  consider == o.consider &&
172
- us_driving_licence == o.us_driving_licence
180
+ us_driving_licence == o.us_driving_licence &&
181
+ report_configuration == o.report_configuration
173
182
  end
174
183
 
175
184
  # @see the `==` method
@@ -181,7 +190,7 @@ module Onfido
181
190
  # Calculates hash code according to all attributes.
182
191
  # @return [Integer] Hash code
183
192
  def hash
184
- [report_names, document_ids, applicant_provides_data, asynchronous, suppress_form_emails, sub_result, consider, us_driving_licence].hash
193
+ [report_names, document_ids, applicant_provides_data, asynchronous, suppress_form_emails, sub_result, consider, us_driving_licence, report_configuration].hash
185
194
  end
186
195
 
187
196
  # Builds the object from hash
@@ -117,6 +117,9 @@ module Onfido
117
117
  # Comma-separated vehicle classes that the user is qualified for
118
118
  attr_accessor :raw_vehicle_classes
119
119
 
120
+ # True if the user is not qualified to drive a manual transmission
121
+ attr_accessor :manual_transmission_restriction
122
+
120
123
  # Detailed classes/categories information
121
124
  attr_accessor :vehicle_class_details
122
125
 
@@ -196,6 +199,7 @@ module Onfido
196
199
  :'restricted_licence' => :'restricted_licence',
197
200
  :'raw_licence_category' => :'raw_licence_category',
198
201
  :'raw_vehicle_classes' => :'raw_vehicle_classes',
202
+ :'manual_transmission_restriction' => :'manual_transmission_restriction',
199
203
  :'vehicle_class_details' => :'vehicle_class_details',
200
204
  :'passenger_vehicle' => :'passenger_vehicle'
201
205
  }
@@ -258,6 +262,7 @@ module Onfido
258
262
  :'restricted_licence' => :'Boolean',
259
263
  :'raw_licence_category' => :'String',
260
264
  :'raw_vehicle_classes' => :'String',
265
+ :'manual_transmission_restriction' => :'Boolean',
261
266
  :'vehicle_class_details' => :'Array<DocumentWithDriverVerificationReportAllOfPropertiesAllOfVehicleClassDetailsInner>',
262
267
  :'passenger_vehicle' => :'DocumentWithDriverVerificationReportAllOfPropertiesAllOfPassengerVehicle'
263
268
  }
@@ -493,6 +498,10 @@ module Onfido
493
498
  self.raw_vehicle_classes = attributes[:'raw_vehicle_classes']
494
499
  end
495
500
 
501
+ if attributes.key?(:'manual_transmission_restriction')
502
+ self.manual_transmission_restriction = attributes[:'manual_transmission_restriction']
503
+ end
504
+
496
505
  if attributes.key?(:'vehicle_class_details')
497
506
  if (value = attributes[:'vehicle_class_details']).is_a?(Array)
498
507
  self.vehicle_class_details = value
@@ -609,6 +618,7 @@ module Onfido
609
618
  restricted_licence == o.restricted_licence &&
610
619
  raw_licence_category == o.raw_licence_category &&
611
620
  raw_vehicle_classes == o.raw_vehicle_classes &&
621
+ manual_transmission_restriction == o.manual_transmission_restriction &&
612
622
  vehicle_class_details == o.vehicle_class_details &&
613
623
  passenger_vehicle == o.passenger_vehicle
614
624
  end
@@ -622,7 +632,7 @@ module Onfido
622
632
  # Calculates hash code according to all attributes.
623
633
  # @return [Integer] Hash code
624
634
  def hash
625
- [date_of_birth, date_of_expiry, personal_number, document_numbers, document_type, first_name, middle_name, last_name, gender, issuing_country, nationality, issuing_state, issuing_date, categorisation, mrz_line1, mrz_line2, mrz_line3, address, place_of_birth, spouse_name, widow_name, alias_name, issuing_authority, remarks, civil_state, expatriation, father_name, mother_name, religion, type_of_permit, version_number, document_subtype, profession, security_document_number, tax_number, nist_identity_evidence_strength, has_issuance_confirmation, real_id_compliance, security_tier, address_lines, barcode, nfc, driving_licence_information, document_classification, extracted_data, drivers_licence, restricted_licence, raw_licence_category, raw_vehicle_classes, vehicle_class_details, passenger_vehicle].hash
635
+ [date_of_birth, date_of_expiry, personal_number, document_numbers, document_type, first_name, middle_name, last_name, gender, issuing_country, nationality, issuing_state, issuing_date, categorisation, mrz_line1, mrz_line2, mrz_line3, address, place_of_birth, spouse_name, widow_name, alias_name, issuing_authority, remarks, civil_state, expatriation, father_name, mother_name, religion, type_of_permit, version_number, document_subtype, profession, security_document_number, tax_number, nist_identity_evidence_strength, has_issuance_confirmation, real_id_compliance, security_tier, address_lines, barcode, nfc, driving_licence_information, document_classification, extracted_data, drivers_licence, restricted_licence, raw_licence_category, raw_vehicle_classes, manual_transmission_restriction, vehicle_class_details, passenger_vehicle].hash
626
636
  end
627
637
 
628
638
  # Builds the object from hash
@@ -0,0 +1,242 @@
1
+ =begin
2
+ #Onfido API v3.6
3
+
4
+ #The Onfido API (v3.6)
5
+
6
+ The version of the OpenAPI document: v3.6
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Onfido
17
+ # Defines configuration options for facial similarity checks used to distinguish between onboarding and reverification scenarios.
18
+ class ReportConfiguration
19
+ attr_accessor :facial_similarity_photo
20
+
21
+ attr_accessor :facial_similarity_photo_fully_auto
22
+
23
+ attr_accessor :facial_similarity_video
24
+
25
+ attr_accessor :facial_similarity_motion
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'facial_similarity_photo' => :'facial_similarity_photo',
31
+ :'facial_similarity_photo_fully_auto' => :'facial_similarity_photo_fully_auto',
32
+ :'facial_similarity_video' => :'facial_similarity_video',
33
+ :'facial_similarity_motion' => :'facial_similarity_motion'
34
+ }
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'facial_similarity_photo' => :'ReportConfigurationFacialSimilarity',
46
+ :'facial_similarity_photo_fully_auto' => :'ReportConfigurationFacialSimilarity',
47
+ :'facial_similarity_video' => :'ReportConfigurationFacialSimilarity',
48
+ :'facial_similarity_motion' => :'ReportConfigurationFacialSimilarity'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::ReportConfiguration` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!self.class.attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::ReportConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'facial_similarity_photo')
74
+ self.facial_similarity_photo = attributes[:'facial_similarity_photo']
75
+ end
76
+
77
+ if attributes.key?(:'facial_similarity_photo_fully_auto')
78
+ self.facial_similarity_photo_fully_auto = attributes[:'facial_similarity_photo_fully_auto']
79
+ end
80
+
81
+ if attributes.key?(:'facial_similarity_video')
82
+ self.facial_similarity_video = attributes[:'facial_similarity_video']
83
+ end
84
+
85
+ if attributes.key?(:'facial_similarity_motion')
86
+ self.facial_similarity_motion = attributes[:'facial_similarity_motion']
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
94
+ invalid_properties = Array.new
95
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ warn '[DEPRECATED] the `valid?` method is obsolete'
102
+ true
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ facial_similarity_photo == o.facial_similarity_photo &&
111
+ facial_similarity_photo_fully_auto == o.facial_similarity_photo_fully_auto &&
112
+ facial_similarity_video == o.facial_similarity_video &&
113
+ facial_similarity_motion == o.facial_similarity_motion
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] Object to be compared
118
+ def eql?(o)
119
+ self == o
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Integer] Hash code
124
+ def hash
125
+ [facial_similarity_photo, facial_similarity_photo_fully_auto, facial_similarity_video, facial_similarity_motion].hash
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def self.build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ attributes = attributes.transform_keys(&:to_sym)
134
+ transformed_hash = {}
135
+ openapi_types.each_pair do |key, type|
136
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
137
+ transformed_hash["#{key}"] = nil
138
+ elsif type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[attribute_map[key]].is_a?(Array)
142
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
143
+ end
144
+ elsif !attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
146
+ end
147
+ end
148
+ new(transformed_hash)
149
+ end
150
+
151
+ # Deserializes the data based on type
152
+ # @param string type Data type
153
+ # @param string value Value to be deserialized
154
+ # @return [Object] Deserialized data
155
+ def self._deserialize(type, value)
156
+ case type.to_sym
157
+ when :Time
158
+ Time.parse(value)
159
+ when :Date
160
+ Date.parse(value)
161
+ when :String
162
+ value.to_s
163
+ when :Integer
164
+ value.to_i
165
+ when :Float
166
+ value.to_f
167
+ when :Boolean
168
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
169
+ true
170
+ else
171
+ false
172
+ end
173
+ when :Object
174
+ # generic object (usually a Hash), return directly
175
+ value
176
+ when /\AArray<(?<inner_type>.+)>\z/
177
+ inner_type = Regexp.last_match[:inner_type]
178
+ value.map { |v| _deserialize(inner_type, v) }
179
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
180
+ k_type = Regexp.last_match[:k_type]
181
+ v_type = Regexp.last_match[:v_type]
182
+ {}.tap do |hash|
183
+ value.each do |k, v|
184
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
185
+ end
186
+ end
187
+ else # model
188
+ # models (e.g. Pet) or oneOf
189
+ klass = Onfido.const_get(type)
190
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ if value.nil?
213
+ is_nullable = self.class.openapi_nullable.include?(attr)
214
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
215
+ end
216
+
217
+ hash[param] = _to_hash(value)
218
+ end
219
+ hash
220
+ end
221
+
222
+ # Outputs non-array value in the form of hash
223
+ # For object, use to_hash. Otherwise, just return the value
224
+ # @param [Object] value Any valid value
225
+ # @return [Hash] Returns the value in the form of hash
226
+ def _to_hash(value)
227
+ if value.is_a?(Array)
228
+ value.compact.map { |v| _to_hash(v) }
229
+ elsif value.is_a?(Hash)
230
+ {}.tap do |hash|
231
+ value.each { |k, v| hash[k] = _to_hash(v) }
232
+ end
233
+ elsif value.respond_to? :to_hash
234
+ value.to_hash
235
+ else
236
+ value
237
+ end
238
+ end
239
+
240
+ end
241
+
242
+ end
@@ -0,0 +1,249 @@
1
+ =begin
2
+ #Onfido API v3.6
3
+
4
+ #The Onfido API (v3.6)
5
+
6
+ The version of the OpenAPI document: v3.6
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Onfido
17
+ class ReportConfigurationFacialSimilarity
18
+ # You should set it to \"reverification\" on a post-onboarding scenario (e.g. ongoing authentication).
19
+ attr_accessor :use_case
20
+
21
+ class EnumAttributeValidator
22
+ attr_reader :datatype
23
+ attr_reader :allowable_values
24
+
25
+ def initialize(datatype, allowable_values)
26
+ @allowable_values = allowable_values.map do |value|
27
+ case datatype.to_s
28
+ when /Integer/i
29
+ value.to_i
30
+ when /Float/i
31
+ value.to_f
32
+ else
33
+ value
34
+ end
35
+ end
36
+ end
37
+
38
+ def valid?(value)
39
+ !value || allowable_values.include?(value)
40
+ end
41
+ end
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'use_case' => :'use_case'
47
+ }
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'use_case' => :'String'
59
+ }
60
+ end
61
+
62
+ # List of attributes with nullable: true
63
+ def self.openapi_nullable
64
+ Set.new([
65
+ ])
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::ReportConfigurationFacialSimilarity` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!self.class.attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::ReportConfigurationFacialSimilarity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'use_case')
84
+ self.use_case = attributes[:'use_case']
85
+ end
86
+ end
87
+
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properties with the reasons
90
+ def list_invalid_properties
91
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
92
+ invalid_properties = Array.new
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ warn '[DEPRECATED] the `valid?` method is obsolete'
100
+ use_case_validator = EnumAttributeValidator.new('String', ["onboarding", "reverification", "unknown_default_open_api"])
101
+ return false unless use_case_validator.valid?(@use_case)
102
+ true
103
+ end
104
+
105
+ # Custom attribute writer method checking allowed values (enum).
106
+ # @param [Object] use_case Object to be assigned
107
+ def use_case=(use_case)
108
+ validator = EnumAttributeValidator.new('String', ["onboarding", "reverification", "unknown_default_open_api"])
109
+ unless validator.valid?(use_case)
110
+ fail ArgumentError, "invalid value for \"use_case\", must be one of #{validator.allowable_values}."
111
+ end
112
+ @use_case = use_case
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ use_case == o.use_case
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Integer] Hash code
131
+ def hash
132
+ [use_case].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def self.build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ attributes = attributes.transform_keys(&:to_sym)
141
+ transformed_hash = {}
142
+ openapi_types.each_pair do |key, type|
143
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = nil
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[attribute_map[key]].is_a?(Array)
149
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
150
+ end
151
+ elsif !attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
153
+ end
154
+ end
155
+ new(transformed_hash)
156
+ end
157
+
158
+ # Deserializes the data based on type
159
+ # @param string type Data type
160
+ # @param string value Value to be deserialized
161
+ # @return [Object] Deserialized data
162
+ def self._deserialize(type, value)
163
+ case type.to_sym
164
+ when :Time
165
+ Time.parse(value)
166
+ when :Date
167
+ Date.parse(value)
168
+ when :String
169
+ value.to_s
170
+ when :Integer
171
+ value.to_i
172
+ when :Float
173
+ value.to_f
174
+ when :Boolean
175
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
176
+ true
177
+ else
178
+ false
179
+ end
180
+ when :Object
181
+ # generic object (usually a Hash), return directly
182
+ value
183
+ when /\AArray<(?<inner_type>.+)>\z/
184
+ inner_type = Regexp.last_match[:inner_type]
185
+ value.map { |v| _deserialize(inner_type, v) }
186
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
187
+ k_type = Regexp.last_match[:k_type]
188
+ v_type = Regexp.last_match[:v_type]
189
+ {}.tap do |hash|
190
+ value.each do |k, v|
191
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
192
+ end
193
+ end
194
+ else # model
195
+ # models (e.g. Pet) or oneOf
196
+ klass = Onfido.const_get(type)
197
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
198
+ end
199
+ end
200
+
201
+ # Returns the string representation of the object
202
+ # @return [String] String presentation of the object
203
+ def to_s
204
+ to_hash.to_s
205
+ end
206
+
207
+ # to_body is an alias to to_hash (backward compatibility)
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_body
210
+ to_hash
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ if value.nil?
220
+ is_nullable = self.class.openapi_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
224
+ hash[param] = _to_hash(value)
225
+ end
226
+ hash
227
+ end
228
+
229
+ # Outputs non-array value in the form of hash
230
+ # For object, use to_hash. Otherwise, just return the value
231
+ # @param [Object] value Any valid value
232
+ # @return [Hash] Returns the value in the form of hash
233
+ def _to_hash(value)
234
+ if value.is_a?(Array)
235
+ value.compact.map { |v| _to_hash(v) }
236
+ elsif value.is_a?(Hash)
237
+ {}.tap do |hash|
238
+ value.each { |k, v| hash[k] = _to_hash(v) }
239
+ end
240
+ elsif value.respond_to? :to_hash
241
+ value.to_hash
242
+ else
243
+ value
244
+ end
245
+ end
246
+
247
+ end
248
+
249
+ end
@@ -11,5 +11,5 @@ Generator version: 7.11.0
11
11
  =end
12
12
 
13
13
  module Onfido
14
- VERSION = '5.1.1'
14
+ VERSION = '5.3.0'
15
15
  end
data/lib/onfido.rb CHANGED
@@ -228,6 +228,8 @@ require 'onfido/models/proof_of_address_report'
228
228
  require 'onfido/models/repeat_attempts_list'
229
229
  require 'onfido/models/repeat_attempts_list_repeat_attempts_inner'
230
230
  require 'onfido/models/report'
231
+ require 'onfido/models/report_configuration'
232
+ require 'onfido/models/report_configuration_facial_similarity'
231
233
  require 'onfido/models/report_document'
232
234
  require 'onfido/models/report_name'
233
235
  require 'onfido/models/report_result'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onfido
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.1
4
+ version: 5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-19 00:00:00.000000000 Z
11
+ date: 2025-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -349,6 +349,8 @@ files:
349
349
  - lib/onfido/models/repeat_attempts_list.rb
350
350
  - lib/onfido/models/repeat_attempts_list_repeat_attempts_inner.rb
351
351
  - lib/onfido/models/report.rb
352
+ - lib/onfido/models/report_configuration.rb
353
+ - lib/onfido/models/report_configuration_facial_similarity.rb
352
354
  - lib/onfido/models/report_document.rb
353
355
  - lib/onfido/models/report_name.rb
354
356
  - lib/onfido/models/report_result.rb
@@ -491,34 +493,34 @@ specification_version: 4
491
493
  summary: The official Ruby library for integrating with the Onfido API.
492
494
  test_files:
493
495
  - spec/classic_webhook_event_verifier_spec.rb
494
- - spec/integrations/motion_capture_spec.rb
495
- - spec/integrations/id_photo_spec.rb
496
- - spec/integrations/check_spec.rb
496
+ - spec/integrations/sdk_token_spec.rb
497
+ - spec/integrations/qualified_electronic_signature_spec.rb
498
+ - spec/integrations/applicant_spec.rb
499
+ - spec/integrations/webhook_spec.rb
500
+ - spec/integrations/workflow_run_spec.rb
497
501
  - spec/integrations/live_photo_spec.rb
502
+ - spec/integrations/extraction_spec.rb
503
+ - spec/integrations/live_video_spec.rb
504
+ - spec/integrations/tasks_spec.rb
505
+ - spec/integrations/document_spec.rb
498
506
  - spec/integrations/watchlist_monitor_spec.rb
507
+ - spec/integrations/id_photo_spec.rb
508
+ - spec/integrations/motion_capture_spec.rb
499
509
  - spec/integrations/workflow_run_output_spec.rb
500
- - spec/integrations/media/sample_photo.png
510
+ - spec/integrations/check_spec.rb
511
+ - spec/integrations/report_spec.rb
501
512
  - spec/integrations/media/sample_driving_licence.png
502
- - spec/integrations/live_video_spec.rb
503
- - spec/integrations/document_spec.rb
504
- - spec/integrations/webhook_spec.rb
505
- - spec/integrations/applicant_spec.rb
506
- - spec/integrations/address_picker_spec.rb
507
- - spec/integrations/workflow_run_spec.rb
508
- - spec/integrations/qualified_electronic_signature_spec.rb
513
+ - spec/integrations/media/sample_photo.png
509
514
  - spec/integrations/report_schema_spec.rb
510
- - spec/integrations/sdk_token_spec.rb
511
- - spec/integrations/tasks_spec.rb
512
- - spec/integrations/report_spec.rb
513
- - spec/integrations/extraction_spec.rb
515
+ - spec/integrations/address_picker_spec.rb
514
516
  - spec/media/studio_webhook_event_with_object_in_output.json
515
517
  - spec/media/studio_webhook_event_with_list_in_output.json
516
- - spec/shared_contexts/with_applicant.rb
518
+ - spec/shared_contexts/with_onfido.rb
519
+ - spec/shared_contexts/with_document.rb
517
520
  - spec/shared_contexts/with_check.rb
521
+ - spec/shared_contexts/with_applicant.rb
518
522
  - spec/shared_contexts/with_workflow_run.rb
519
- - spec/shared_contexts/with_onfido.rb
520
523
  - spec/shared_contexts/with_live_photo.rb
521
- - spec/shared_contexts/with_document.rb
522
524
  - spec/shared_examples/file_examples.rb
523
525
  - spec/spec_helper.rb
524
526
  - spec/studio_webhook_event_verifier_spec.rb