From 2c58b02e883b7eb082182c738e81b5900a5f2eb9 Mon Sep 17 00:00:00 2001 From: dvacca-onfido <134616519+dvacca-onfido@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:10:20 +0000 Subject: [PATCH] Upgrade after onfido-openapi-spec change c72181c --- .release.json | 8 +- README.md | 2 +- lib/onfido.rb | 2 + lib/onfido/api_client.rb | 2 +- lib/onfido/models/document_types.rb | 48 +++- .../models/facial_similarity_motion_report.rb | 51 +++- ...cial_similarity_photo_fully_auto_report.rb | 51 +++- .../models/facial_similarity_photo_report.rb | 51 +++- .../models/facial_similarity_report_media.rb | 222 +++++++++++++++ .../models/facial_similarity_report_shared.rb | 253 ++++++++++++++++++ .../models/facial_similarity_video_report.rb | 51 +++- lib/onfido/version.rb | 2 +- 12 files changed, 731 insertions(+), 12 deletions(-) create mode 100644 lib/onfido/models/facial_similarity_report_media.rb create mode 100644 lib/onfido/models/facial_similarity_report_shared.rb diff --git a/.release.json b/.release.json index e6a0583..c184dba 100644 --- a/.release.json +++ b/.release.json @@ -1,9 +1,9 @@ { "source": { "repo_url": "https://github.com/onfido/onfido-openapi-spec", - "short_sha": "d180edd", - "long_sha": "d180eddd168dd95bf84bf7c8fe9f8c7e3c0c5494", - "version": "v4.1.0" + "short_sha": "c72181c", + "long_sha": "c72181cc5e450bf727fc5eae2639c58ba45831ac", + "version": "v4.2.0" }, - "release": "v4.1.0" + "release": "v4.2.0" } diff --git a/README.md b/README.md index e20393e..1cc27ae 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ This version uses Onfido API v3.6. Refer to our [API versioning guide](https://d ### Installation ```ruby -gem onfido, '~> 4.1.0' +gem onfido, '~> 4.2.0' ``` Configure with your API token, region and optional timeout (default value is 30): diff --git a/lib/onfido.rb b/lib/onfido.rb index 6444ef9..421cee3 100644 --- a/lib/onfido.rb +++ b/lib/onfido.rb @@ -151,6 +151,8 @@ require 'onfido/models/facial_similarity_photo_fully_auto_report' require 'onfido/models/facial_similarity_photo_properties' require 'onfido/models/facial_similarity_photo_report' +require 'onfido/models/facial_similarity_report_media' +require 'onfido/models/facial_similarity_report_shared' require 'onfido/models/facial_similarity_video_breakdown' require 'onfido/models/facial_similarity_video_breakdown_face_comparison' require 'onfido/models/facial_similarity_video_breakdown_image_integrity' diff --git a/lib/onfido/api_client.rb b/lib/onfido/api_client.rb index 5f4eaea..f5e071d 100644 --- a/lib/onfido/api_client.rb +++ b/lib/onfido/api_client.rb @@ -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.1.0" + @user_agent = "onfido-ruby/4.2.0" @default_headers = { 'Content-Type' => 'application/json', 'User-Agent' => @user_agent diff --git a/lib/onfido/models/document_types.rb b/lib/onfido/models/document_types.rb index e182cc8..7ce0c89 100644 --- a/lib/onfido/models/document_types.rb +++ b/lib/onfido/models/document_types.rb @@ -45,10 +45,56 @@ class DocumentTypes VEHICLE_REGISTRATION_CERTIFICATE = "vehicle_registration_certificate".freeze FORM_FOR_AFFIXING_THE_VISA = "form_for_affixing_the_visa".freeze IDENTIFICATION_NUMBER_DOCUMENT = "identification_number_document".freeze + ADOPTION_CERTIFICATE = "adoption_certificate".freeze + BANK_BUILDING_SOCIETY_STATEMENT = "bank_building_society_statement".freeze + BANK_STATEMENT = "bank_statement".freeze + BENEFIT_LETTERS = "benefit_letters".freeze + CBT = "cbt".freeze + CERTIFICATE_OF_SPONSORSHIP = "certificate_of_sponsorship".freeze + CHARACTER_REFERENCE = "character_reference".freeze + CIVIL_PARTNERSHIP_CERTIFICATE = "civil_partnership_certificate".freeze + COUNCIL_TAX = "council_tax".freeze + CREDIT_CARD_STATEMENT = "credit_card_statement".freeze + DEED_POLL = "deed_poll".freeze + DIVORCE_ABSOLUTE_DECREE = "divorce_absolute_decree".freeze + EDUCATIONAL_STATEMENT = "educational_statement".freeze + ELECTRICITY_BILL = "electricity_bill".freeze + GAS_BILL = "gas_bill".freeze + GOVERNMENT_LETTER = "government_letter".freeze + INTERNET_BILL = "internet_bill".freeze + MARRIAGE_CERTIFICATE = "marriage_certificate".freeze + MOTORCYCLE_INSURANCE = "motorcycle_insurance".freeze + NATIONAL_INSURANCE_CARD = "national_insurance_card".freeze + NATURALISATION_CERTIFICATE = "naturalisation_certificate".freeze + NON_UK_DRIVING_LICENCE = "non_uk_driving_licence".freeze + P45_P60 = "p45_p60".freeze + PAYSLIP = "payslip".freeze + PHONE_BILL = "phone_bill".freeze + PROFESSIONAL_IDENTIFICATION_CARD = "professional_identification_card".freeze + RIGHT_TO_WORK_SHARE_CODE_RESULT = "right_to_work_share_code_result".freeze + STATEMENT_FACT = "statement_fact".freeze + T4_STUDENT_UNIVERSITY_TERM_DATES_EVIDENCE = "t4_student_university_term_dates_evidence".freeze + UK_BIOMETRIC_RESIDENCE_PERMIT = "uk_biometric_residence_permit".freeze + UK_DRIVING_LICENCE = "uk_driving_licence".freeze + UNKNOWN = "unknown".freeze + UTILITY_BILL = "utility_bill".freeze + UTILITY_BILL_ELECTRIC = "utility_bill_electric".freeze + UTILITY_BILL_GAS = "utility_bill_gas".freeze + UTILITY_BILL_OTHER = "utility_bill_other".freeze + WATER_BILL = "water_bill".freeze + ADDRESS_CERTIFICATE = "address_certificate".freeze + GENERAL_LETTER = "general_letter".freeze + INSURANCE_STATEMENT = "insurance_statement".freeze + PENSION_PROPERTY_STATEMENT_LETTER = "pension_property_statement_letter".freeze + MORTGAGE_STATEMENT = "mortgage_statement".freeze + MOBILE_PHONE_BILL = "mobile_phone_bill".freeze + IDENTITY_DOCUMENT_WITH_ADDRESS = "identity_document_with_address".freeze + EXCHANGE_HOUSE_STATEMENT = "exchange_house_statement".freeze + ACCOMMODATION_TENANCY_CERTIFICATE = "accommodation_tenancy_certificate".freeze UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze def self.all_vars - @all_vars ||= [PASSPORT, DRIVING_LICENCE, NATIONAL_IDENTITY_CARD, RESIDENCE_PERMIT, PASSPORT_CARD, TAX_ID, VISA, VOTER_ID, RESIDENCE_STATUS_DOCUMENT, POSTAL_IDENTITY_CARD, SOCIAL_SECURITY_CARD, WORK_PERMIT, ASYLUM_REGISTRATION_CARD, NATIONAL_HEALTH_INSURANCE_CARD, MUNICIPALITY_IDENTITY_CARD, PRIVATE_OPERATORS_CARD, PROOF_OF_CITIZENSHIP, SERVICE_ID_CARD, IMMIGRATION_STATUS_DOCUMENT, INDIGENOUS_CARD, VEHICLE_REGISTRATION_CARD, CERTIFICATE_OF_NATURALISATION, PROFESSIONAL_QUALIFICATION_CARD, CONSULAR_ID, INTERNATIONAL_DRIVING_LICENCE, HOME_OFFICE_LETTER, BIRTH_CERTIFICATE, VEHICLE_REGISTRATION_CERTIFICATE, FORM_FOR_AFFIXING_THE_VISA, IDENTIFICATION_NUMBER_DOCUMENT, UNKNOWN_DEFAULT_OPEN_API].freeze + @all_vars ||= [PASSPORT, DRIVING_LICENCE, NATIONAL_IDENTITY_CARD, RESIDENCE_PERMIT, PASSPORT_CARD, TAX_ID, VISA, VOTER_ID, RESIDENCE_STATUS_DOCUMENT, POSTAL_IDENTITY_CARD, SOCIAL_SECURITY_CARD, WORK_PERMIT, ASYLUM_REGISTRATION_CARD, NATIONAL_HEALTH_INSURANCE_CARD, MUNICIPALITY_IDENTITY_CARD, PRIVATE_OPERATORS_CARD, PROOF_OF_CITIZENSHIP, SERVICE_ID_CARD, IMMIGRATION_STATUS_DOCUMENT, INDIGENOUS_CARD, VEHICLE_REGISTRATION_CARD, CERTIFICATE_OF_NATURALISATION, PROFESSIONAL_QUALIFICATION_CARD, CONSULAR_ID, INTERNATIONAL_DRIVING_LICENCE, HOME_OFFICE_LETTER, BIRTH_CERTIFICATE, VEHICLE_REGISTRATION_CERTIFICATE, FORM_FOR_AFFIXING_THE_VISA, IDENTIFICATION_NUMBER_DOCUMENT, ADOPTION_CERTIFICATE, BANK_BUILDING_SOCIETY_STATEMENT, BANK_STATEMENT, BENEFIT_LETTERS, CBT, CERTIFICATE_OF_SPONSORSHIP, CHARACTER_REFERENCE, CIVIL_PARTNERSHIP_CERTIFICATE, COUNCIL_TAX, CREDIT_CARD_STATEMENT, DEED_POLL, DIVORCE_ABSOLUTE_DECREE, EDUCATIONAL_STATEMENT, ELECTRICITY_BILL, GAS_BILL, GOVERNMENT_LETTER, INTERNET_BILL, MARRIAGE_CERTIFICATE, MOTORCYCLE_INSURANCE, NATIONAL_INSURANCE_CARD, NATURALISATION_CERTIFICATE, NON_UK_DRIVING_LICENCE, P45_P60, PAYSLIP, PHONE_BILL, PROFESSIONAL_IDENTIFICATION_CARD, RIGHT_TO_WORK_SHARE_CODE_RESULT, STATEMENT_FACT, T4_STUDENT_UNIVERSITY_TERM_DATES_EVIDENCE, UK_BIOMETRIC_RESIDENCE_PERMIT, UK_DRIVING_LICENCE, UNKNOWN, UTILITY_BILL, UTILITY_BILL_ELECTRIC, UTILITY_BILL_GAS, UTILITY_BILL_OTHER, WATER_BILL, ADDRESS_CERTIFICATE, GENERAL_LETTER, INSURANCE_STATEMENT, PENSION_PROPERTY_STATEMENT_LETTER, MORTGAGE_STATEMENT, MOBILE_PHONE_BILL, IDENTITY_DOCUMENT_WITH_ADDRESS, EXCHANGE_HOUSE_STATEMENT, ACCOMMODATION_TENANCY_CERTIFICATE, UNKNOWN_DEFAULT_OPEN_API].freeze end # Builds the enum from string diff --git a/lib/onfido/models/facial_similarity_motion_report.rb b/lib/onfido/models/facial_similarity_motion_report.rb index ddd1dbd..c1a3755 100644 --- a/lib/onfido/models/facial_similarity_motion_report.rb +++ b/lib/onfido/models/facial_similarity_motion_report.rb @@ -38,6 +38,18 @@ class FacialSimilarityMotionReport attr_accessor :name + # Array of objects with live photo ids that were used in the Onfido engine. + attr_accessor :live_photos + + # Array of objects with live video ids that were used in the Onfido engine. + attr_accessor :live_videos + + # Array of objects with motion capture ids that were used in the Onfido engine. + attr_accessor :motion_captures + + # Array of objects with id photo ids that were used in the Onfido engine. + attr_accessor :id_photos + attr_accessor :breakdown attr_accessor :properties @@ -76,6 +88,10 @@ def self.attribute_map :'check_id' => :'check_id', :'documents' => :'documents', :'name' => :'name', + :'live_photos' => :'live_photos', + :'live_videos' => :'live_videos', + :'motion_captures' => :'motion_captures', + :'id_photos' => :'id_photos', :'breakdown' => :'breakdown', :'properties' => :'properties' } @@ -98,6 +114,10 @@ def self.openapi_types :'check_id' => :'String', :'documents' => :'Array', :'name' => :'ReportName', + :'live_photos' => :'Array', + :'live_videos' => :'Array', + :'motion_captures' => :'Array', + :'id_photos' => :'Array', :'breakdown' => :'FacialSimilarityMotionBreakdown', :'properties' => :'FacialSimilarityMotionProperties' } @@ -112,6 +132,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ + :'FacialSimilarityReportShared', :'ReportShared' ] end @@ -173,6 +194,30 @@ def initialize(attributes = {}) self.name = nil end + if attributes.key?(:'live_photos') + if (value = attributes[:'live_photos']).is_a?(Array) + self.live_photos = value + end + end + + if attributes.key?(:'live_videos') + if (value = attributes[:'live_videos']).is_a?(Array) + self.live_videos = value + end + end + + if attributes.key?(:'motion_captures') + if (value = attributes[:'motion_captures']).is_a?(Array) + self.motion_captures = value + end + end + + if attributes.key?(:'id_photos') + if (value = attributes[:'id_photos']).is_a?(Array) + self.id_photos = value + end + end + if attributes.key?(:'breakdown') self.breakdown = attributes[:'breakdown'] end @@ -221,6 +266,10 @@ def ==(o) check_id == o.check_id && documents == o.documents && name == o.name && + live_photos == o.live_photos && + live_videos == o.live_videos && + motion_captures == o.motion_captures && + id_photos == o.id_photos && breakdown == o.breakdown && properties == o.properties end @@ -234,7 +283,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, created_at, href, status, result, sub_result, check_id, documents, name, breakdown, properties].hash + [id, created_at, href, status, result, sub_result, check_id, documents, name, live_photos, live_videos, motion_captures, id_photos, breakdown, properties].hash end # Builds the object from hash diff --git a/lib/onfido/models/facial_similarity_photo_fully_auto_report.rb b/lib/onfido/models/facial_similarity_photo_fully_auto_report.rb index 3fad3ec..2a77bbf 100644 --- a/lib/onfido/models/facial_similarity_photo_fully_auto_report.rb +++ b/lib/onfido/models/facial_similarity_photo_fully_auto_report.rb @@ -38,6 +38,18 @@ class FacialSimilarityPhotoFullyAutoReport attr_accessor :name + # Array of objects with live photo ids that were used in the Onfido engine. + attr_accessor :live_photos + + # Array of objects with live video ids that were used in the Onfido engine. + attr_accessor :live_videos + + # Array of objects with motion capture ids that were used in the Onfido engine. + attr_accessor :motion_captures + + # Array of objects with id photo ids that were used in the Onfido engine. + attr_accessor :id_photos + attr_accessor :breakdown attr_accessor :properties @@ -76,6 +88,10 @@ def self.attribute_map :'check_id' => :'check_id', :'documents' => :'documents', :'name' => :'name', + :'live_photos' => :'live_photos', + :'live_videos' => :'live_videos', + :'motion_captures' => :'motion_captures', + :'id_photos' => :'id_photos', :'breakdown' => :'breakdown', :'properties' => :'properties' } @@ -98,6 +114,10 @@ def self.openapi_types :'check_id' => :'String', :'documents' => :'Array', :'name' => :'ReportName', + :'live_photos' => :'Array', + :'live_videos' => :'Array', + :'motion_captures' => :'Array', + :'id_photos' => :'Array', :'breakdown' => :'FacialSimilarityPhotoFullyAutoBreakdown', :'properties' => :'FacialSimilarityPhotoFullyAutoProperties' } @@ -112,6 +132,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ + :'FacialSimilarityReportShared', :'ReportShared' ] end @@ -173,6 +194,30 @@ def initialize(attributes = {}) self.name = nil end + if attributes.key?(:'live_photos') + if (value = attributes[:'live_photos']).is_a?(Array) + self.live_photos = value + end + end + + if attributes.key?(:'live_videos') + if (value = attributes[:'live_videos']).is_a?(Array) + self.live_videos = value + end + end + + if attributes.key?(:'motion_captures') + if (value = attributes[:'motion_captures']).is_a?(Array) + self.motion_captures = value + end + end + + if attributes.key?(:'id_photos') + if (value = attributes[:'id_photos']).is_a?(Array) + self.id_photos = value + end + end + if attributes.key?(:'breakdown') self.breakdown = attributes[:'breakdown'] end @@ -221,6 +266,10 @@ def ==(o) check_id == o.check_id && documents == o.documents && name == o.name && + live_photos == o.live_photos && + live_videos == o.live_videos && + motion_captures == o.motion_captures && + id_photos == o.id_photos && breakdown == o.breakdown && properties == o.properties end @@ -234,7 +283,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, created_at, href, status, result, sub_result, check_id, documents, name, breakdown, properties].hash + [id, created_at, href, status, result, sub_result, check_id, documents, name, live_photos, live_videos, motion_captures, id_photos, breakdown, properties].hash end # Builds the object from hash diff --git a/lib/onfido/models/facial_similarity_photo_report.rb b/lib/onfido/models/facial_similarity_photo_report.rb index 0ecc8bc..0c5b9f3 100644 --- a/lib/onfido/models/facial_similarity_photo_report.rb +++ b/lib/onfido/models/facial_similarity_photo_report.rb @@ -38,6 +38,18 @@ class FacialSimilarityPhotoReport attr_accessor :name + # Array of objects with live photo ids that were used in the Onfido engine. + attr_accessor :live_photos + + # Array of objects with live video ids that were used in the Onfido engine. + attr_accessor :live_videos + + # Array of objects with motion capture ids that were used in the Onfido engine. + attr_accessor :motion_captures + + # Array of objects with id photo ids that were used in the Onfido engine. + attr_accessor :id_photos + attr_accessor :breakdown attr_accessor :properties @@ -76,6 +88,10 @@ def self.attribute_map :'check_id' => :'check_id', :'documents' => :'documents', :'name' => :'name', + :'live_photos' => :'live_photos', + :'live_videos' => :'live_videos', + :'motion_captures' => :'motion_captures', + :'id_photos' => :'id_photos', :'breakdown' => :'breakdown', :'properties' => :'properties' } @@ -98,6 +114,10 @@ def self.openapi_types :'check_id' => :'String', :'documents' => :'Array', :'name' => :'ReportName', + :'live_photos' => :'Array', + :'live_videos' => :'Array', + :'motion_captures' => :'Array', + :'id_photos' => :'Array', :'breakdown' => :'FacialSimilarityPhotoBreakdown', :'properties' => :'FacialSimilarityPhotoProperties' } @@ -112,6 +132,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ + :'FacialSimilarityReportShared', :'ReportShared' ] end @@ -173,6 +194,30 @@ def initialize(attributes = {}) self.name = nil end + if attributes.key?(:'live_photos') + if (value = attributes[:'live_photos']).is_a?(Array) + self.live_photos = value + end + end + + if attributes.key?(:'live_videos') + if (value = attributes[:'live_videos']).is_a?(Array) + self.live_videos = value + end + end + + if attributes.key?(:'motion_captures') + if (value = attributes[:'motion_captures']).is_a?(Array) + self.motion_captures = value + end + end + + if attributes.key?(:'id_photos') + if (value = attributes[:'id_photos']).is_a?(Array) + self.id_photos = value + end + end + if attributes.key?(:'breakdown') self.breakdown = attributes[:'breakdown'] end @@ -221,6 +266,10 @@ def ==(o) check_id == o.check_id && documents == o.documents && name == o.name && + live_photos == o.live_photos && + live_videos == o.live_videos && + motion_captures == o.motion_captures && + id_photos == o.id_photos && breakdown == o.breakdown && properties == o.properties end @@ -234,7 +283,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, created_at, href, status, result, sub_result, check_id, documents, name, breakdown, properties].hash + [id, created_at, href, status, result, sub_result, check_id, documents, name, live_photos, live_videos, motion_captures, id_photos, breakdown, properties].hash end # Builds the object from hash diff --git a/lib/onfido/models/facial_similarity_report_media.rb b/lib/onfido/models/facial_similarity_report_media.rb new file mode 100644 index 0000000..4df8cae --- /dev/null +++ b/lib/onfido/models/facial_similarity_report_media.rb @@ -0,0 +1,222 @@ +=begin +#Onfido API v3.6 + +#The Onfido API (v3.6) + +The version of the OpenAPI document: v3.6 + +Generated by: https://openapi-generator.tech +Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Onfido + class FacialSimilarityReportMedia + # ID of uploaded biometric media to use. + attr_accessor :id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @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::FacialSimilarityReportMedia` 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::FacialSimilarityReportMedia`. 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 + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Onfido.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onfido/models/facial_similarity_report_shared.rb b/lib/onfido/models/facial_similarity_report_shared.rb new file mode 100644 index 0000000..e5dc652 --- /dev/null +++ b/lib/onfido/models/facial_similarity_report_shared.rb @@ -0,0 +1,253 @@ +=begin +#Onfido API v3.6 + +#The Onfido API (v3.6) + +The version of the OpenAPI document: v3.6 + +Generated by: https://openapi-generator.tech +Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Onfido + class FacialSimilarityReportShared + # Array of objects with live photo ids that were used in the Onfido engine. + attr_accessor :live_photos + + # Array of objects with live video ids that were used in the Onfido engine. + attr_accessor :live_videos + + # Array of objects with motion capture ids that were used in the Onfido engine. + attr_accessor :motion_captures + + # Array of objects with id photo ids that were used in the Onfido engine. + attr_accessor :id_photos + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'live_photos' => :'live_photos', + :'live_videos' => :'live_videos', + :'motion_captures' => :'motion_captures', + :'id_photos' => :'id_photos' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'live_photos' => :'Array', + :'live_videos' => :'Array', + :'motion_captures' => :'Array', + :'id_photos' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @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::FacialSimilarityReportShared` 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::FacialSimilarityReportShared`. 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 + } + + if attributes.key?(:'live_photos') + if (value = attributes[:'live_photos']).is_a?(Array) + self.live_photos = value + end + end + + if attributes.key?(:'live_videos') + if (value = attributes[:'live_videos']).is_a?(Array) + self.live_videos = value + end + end + + if attributes.key?(:'motion_captures') + if (value = attributes[:'motion_captures']).is_a?(Array) + self.motion_captures = value + end + end + + if attributes.key?(:'id_photos') + if (value = attributes[:'id_photos']).is_a?(Array) + self.id_photos = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + live_photos == o.live_photos && + live_videos == o.live_videos && + motion_captures == o.motion_captures && + id_photos == o.id_photos + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [live_photos, live_videos, motion_captures, id_photos].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Onfido.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onfido/models/facial_similarity_video_report.rb b/lib/onfido/models/facial_similarity_video_report.rb index 7b3f2eb..4e50f61 100644 --- a/lib/onfido/models/facial_similarity_video_report.rb +++ b/lib/onfido/models/facial_similarity_video_report.rb @@ -38,6 +38,18 @@ class FacialSimilarityVideoReport attr_accessor :name + # Array of objects with live photo ids that were used in the Onfido engine. + attr_accessor :live_photos + + # Array of objects with live video ids that were used in the Onfido engine. + attr_accessor :live_videos + + # Array of objects with motion capture ids that were used in the Onfido engine. + attr_accessor :motion_captures + + # Array of objects with id photo ids that were used in the Onfido engine. + attr_accessor :id_photos + attr_accessor :breakdown attr_accessor :properties @@ -76,6 +88,10 @@ def self.attribute_map :'check_id' => :'check_id', :'documents' => :'documents', :'name' => :'name', + :'live_photos' => :'live_photos', + :'live_videos' => :'live_videos', + :'motion_captures' => :'motion_captures', + :'id_photos' => :'id_photos', :'breakdown' => :'breakdown', :'properties' => :'properties' } @@ -98,6 +114,10 @@ def self.openapi_types :'check_id' => :'String', :'documents' => :'Array', :'name' => :'ReportName', + :'live_photos' => :'Array', + :'live_videos' => :'Array', + :'motion_captures' => :'Array', + :'id_photos' => :'Array', :'breakdown' => :'FacialSimilarityVideoBreakdown', :'properties' => :'FacialSimilarityVideoProperties' } @@ -112,6 +132,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ + :'FacialSimilarityReportShared', :'ReportShared' ] end @@ -173,6 +194,30 @@ def initialize(attributes = {}) self.name = nil end + if attributes.key?(:'live_photos') + if (value = attributes[:'live_photos']).is_a?(Array) + self.live_photos = value + end + end + + if attributes.key?(:'live_videos') + if (value = attributes[:'live_videos']).is_a?(Array) + self.live_videos = value + end + end + + if attributes.key?(:'motion_captures') + if (value = attributes[:'motion_captures']).is_a?(Array) + self.motion_captures = value + end + end + + if attributes.key?(:'id_photos') + if (value = attributes[:'id_photos']).is_a?(Array) + self.id_photos = value + end + end + if attributes.key?(:'breakdown') self.breakdown = attributes[:'breakdown'] end @@ -221,6 +266,10 @@ def ==(o) check_id == o.check_id && documents == o.documents && name == o.name && + live_photos == o.live_photos && + live_videos == o.live_videos && + motion_captures == o.motion_captures && + id_photos == o.id_photos && breakdown == o.breakdown && properties == o.properties end @@ -234,7 +283,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, created_at, href, status, result, sub_result, check_id, documents, name, breakdown, properties].hash + [id, created_at, href, status, result, sub_result, check_id, documents, name, live_photos, live_videos, motion_captures, id_photos, breakdown, properties].hash end # Builds the object from hash diff --git a/lib/onfido/version.rb b/lib/onfido/version.rb index d742dc4..612988b 100644 --- a/lib/onfido/version.rb +++ b/lib/onfido/version.rb @@ -11,5 +11,5 @@ =end module Onfido - VERSION = '4.1.0' + VERSION = '4.2.0' end