Skip to content

Commit

Permalink
Merge pull request #68 from onfido/release-upgrade
Browse files Browse the repository at this point in the history
Refresh onfido-ruby after onfido-openapi-spec update (d180edd)
  • Loading branch information
dvacca-onfido authored Nov 8, 2024
2 parents fdae07e + bacac76 commit 13dfc0e
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .release.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"source": {
"repo_url": "https://github.com/onfido/onfido-openapi-spec",
"short_sha": "2998dd3",
"long_sha": "2998dd3ad2db49a33e0ecf9b41c7cf873909ef0b",
"version": "v4.0.0"
"short_sha": "d180edd",
"long_sha": "d180eddd168dd95bf84bf7c8fe9f8c7e3c0c5494",
"version": "v4.1.0"
},
"release": "v4.0.0"
"release": "v4.1.0"
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This version uses Onfido API v3.6. Refer to our [API versioning guide](https://d
### Installation

```ruby
gem onfido, '~> 4.0.0'
gem onfido, '~> 4.1.0'
```

Configure with your API token, region and optional timeout (default value is 30):
Expand Down
2 changes: 1 addition & 1 deletion lib/onfido.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
require 'onfido/models/document_odp_reasons'
require 'onfido/models/document_properties'
require 'onfido/models/document_properties_address_lines'
require 'onfido/models/document_properties_barcode_inner'
require 'onfido/models/document_properties_barcode'
require 'onfido/models/document_properties_document_classification'
require 'onfido/models/document_properties_document_numbers_inner'
require 'onfido/models/document_properties_driving_licence_information'
Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ApiClient
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
def initialize(config = Configuration.default)
@config = config
@user_agent = "onfido-ruby/4.0.0"
@user_agent = "onfido-ruby/4.1.0"
@default_headers = {
'Content-Type' => 'application/json',
'User-Agent' => @user_agent
Expand Down
6 changes: 2 additions & 4 deletions lib/onfido/models/document_properties.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def self.openapi_types
:'real_id_compliance' => :'Boolean',
:'security_tier' => :'String',
:'address_lines' => :'DocumentPropertiesAddressLines',
:'barcode' => :'Array<DocumentPropertiesBarcodeInner>',
:'barcode' => :'DocumentPropertiesBarcode',
:'nfc' => :'DocumentPropertiesNfc',
:'driving_licence_information' => :'DocumentPropertiesDrivingLicenceInformation',
:'document_classification' => :'DocumentPropertiesDocumentClassification',
Expand Down Expand Up @@ -418,9 +418,7 @@ def initialize(attributes = {})
end

if attributes.key?(:'barcode')
if (value = attributes[:'barcode']).is_a?(Array)
self.barcode = value
end
self.barcode = attributes[:'barcode']
end

if attributes.key?(:'nfc')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
require 'time'

module Onfido
class DocumentPropertiesBarcodeInner
class DocumentPropertiesBarcode
attr_accessor :first_name

attr_accessor :middle_name
Expand Down Expand Up @@ -114,13 +114,13 @@ def self.openapi_nullable
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::DocumentPropertiesBarcodeInner` initialize method"
fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::DocumentPropertiesBarcode` initialize method"
end

# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::DocumentPropertiesBarcodeInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::DocumentPropertiesBarcode`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def self.openapi_types
:'real_id_compliance' => :'Boolean',
:'security_tier' => :'String',
:'address_lines' => :'DocumentPropertiesAddressLines',
:'barcode' => :'Array<DocumentPropertiesBarcodeInner>',
:'barcode' => :'DocumentPropertiesBarcode',
:'nfc' => :'DocumentPropertiesNfc',
:'driving_licence_information' => :'DocumentPropertiesDrivingLicenceInformation',
:'document_classification' => :'DocumentPropertiesDocumentClassification',
Expand Down Expand Up @@ -454,9 +454,7 @@ def initialize(attributes = {})
end

if attributes.key?(:'barcode')
if (value = attributes[:'barcode']).is_a?(Array)
self.barcode = value
end
self.barcode = attributes[:'barcode']
end

if attributes.key?(:'nfc')
Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
=end

module Onfido
VERSION = '4.0.0'
VERSION = '4.1.0'
end
17 changes: 17 additions & 0 deletions spec/integrations/report_schema_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,22 @@

expect(facial_similarity_report).to be_an_instance_of Onfido::FacialSimilarityPhotoReport
end

it 'schema of Document With Address Information report is valid' do
report_id = onfido_api.create_check(
Onfido::CheckBuilder.new(
applicant_id: applicant_id,
document_ids: [document_id],
report_names: [Onfido::ReportName::DOCUMENT_WITH_ADDRESS_INFORMATION],
)).report_ids[0]

report = repeat_request_until_status_changes(
Onfido::ReportStatus::COMPLETE
) { onfido_api.find_report(report_id) }

expect(report).to be_an_instance_of Onfido::DocumentWithAddressInformationReport
expect(report.properties.barcode).to be_an_instance_of Onfido::DocumentPropertiesBarcode
expect(report.properties.barcode.document_type).to eq("driving_licence")
end
end
end

0 comments on commit 13dfc0e

Please sign in to comment.