diff --git a/.release.json b/.release.json index 214ba4b..8a027d2 100644 --- a/.release.json +++ b/.release.json @@ -1,8 +1,8 @@ { "source": { "repo_url": "https://github.com/onfido/onfido-openapi-spec", - "short_sha": "d9d749d", - "long_sha": "d9d749dfbd3873524400efe236f7d398bb9e948e", + "short_sha": "ad80494", + "long_sha": "ad8049477731f42993257dd8cbbbd4a193f06c92", "version": "v6.2.0" }, "release": "v6.3.0" diff --git a/lib/onfido.rb b/lib/onfido.rb index 0bbbc26..b093fe0 100644 --- a/lib/onfido.rb +++ b/lib/onfido.rb @@ -35,8 +35,9 @@ require 'onfido/models/applicants_list' require 'onfido/models/biometric_token' require 'onfido/models/biometric_token_data' +require 'onfido/models/biometric_token_response' require 'onfido/models/biometric_token_updater' -require 'onfido/models/biometric_tokens_list' +require 'onfido/models/biometric_tokens_response' require 'onfido/models/check' require 'onfido/models/check_builder' require 'onfido/models/check_request' @@ -205,9 +206,10 @@ require 'onfido/models/india_pan_report_all_of_breakdown_device_breakdown_pan_valid' require 'onfido/models/india_pan_report_all_of_properties' require 'onfido/models/india_pan_report_all_of_properties_device' +require 'onfido/models/invalidated_biometric_token_response' require 'onfido/models/invalidated_biometric_token_summary' require 'onfido/models/invalidated_biometric_token_summary_deleted_items' -require 'onfido/models/invalidated_biometric_tokens_summary' +require 'onfido/models/invalidated_biometric_tokens_response' require 'onfido/models/known_faces_breakdown' require 'onfido/models/known_faces_breakdown_image_integrity' require 'onfido/models/known_faces_breakdown_previously_seen_faces' @@ -262,7 +264,7 @@ require 'onfido/models/task' require 'onfido/models/task_item' require 'onfido/models/timeline_file_reference' -require 'onfido/models/update_biometric_token200_response' +require 'onfido/models/updated_biometric_token_response' require 'onfido/models/us_driving_licence_breakdown' require 'onfido/models/us_driving_licence_breakdown_address' require 'onfido/models/us_driving_licence_breakdown_address_breakdown' diff --git a/lib/onfido/api/default_api.rb b/lib/onfido/api/default_api.rb index 66d411d..501ce46 100644 --- a/lib/onfido/api/default_api.rb +++ b/lib/onfido/api/default_api.rb @@ -2181,7 +2181,7 @@ def find_applicant_consents_with_http_info(applicant_id, opts = {}) # @param user_id [String] Customer user ID that owns the biometric token. # @param token_uuid [String] Biometric token UUID. # @param [Hash] opts the optional parameters - # @return [BiometricToken] + # @return [BiometricTokenResponse] def find_biometric_token(user_id, token_uuid, opts = {}) data, _status_code, _headers = find_biometric_token_with_http_info(user_id, token_uuid, opts) data @@ -2192,7 +2192,7 @@ def find_biometric_token(user_id, token_uuid, opts = {}) # @param user_id [String] Customer user ID that owns the biometric token. # @param token_uuid [String] Biometric token UUID. # @param [Hash] opts the optional parameters - # @return [Array<(BiometricToken, Integer, Hash)>] BiometricToken data, response status code and response headers + # @return [Array<(BiometricTokenResponse, Integer, Hash)>] BiometricTokenResponse data, response status code and response headers def find_biometric_token_with_http_info(user_id, token_uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.find_biometric_token ...' @@ -2223,7 +2223,7 @@ def find_biometric_token_with_http_info(user_id, token_uuid, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'BiometricToken' + return_type = opts[:debug_return_type] || 'BiometricTokenResponse' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2ClientCredentials', 'Token'] @@ -3281,7 +3281,7 @@ def generate_sdk_token_with_http_info(sdk_token_builder, opts = {}) # @param user_id [String] Customer user ID that owns the biometric token. # @param token_uuid [String] Biometric token UUID. # @param [Hash] opts the optional parameters - # @return [InvalidatedBiometricTokenSummary] + # @return [InvalidatedBiometricTokenResponse] def invalidate_biometric_token(user_id, token_uuid, opts = {}) data, _status_code, _headers = invalidate_biometric_token_with_http_info(user_id, token_uuid, opts) data @@ -3292,7 +3292,7 @@ def invalidate_biometric_token(user_id, token_uuid, opts = {}) # @param user_id [String] Customer user ID that owns the biometric token. # @param token_uuid [String] Biometric token UUID. # @param [Hash] opts the optional parameters - # @return [Array<(InvalidatedBiometricTokenSummary, Integer, Hash)>] InvalidatedBiometricTokenSummary data, response status code and response headers + # @return [Array<(InvalidatedBiometricTokenResponse, Integer, Hash)>] InvalidatedBiometricTokenResponse data, response status code and response headers def invalidate_biometric_token_with_http_info(user_id, token_uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.invalidate_biometric_token ...' @@ -3323,7 +3323,7 @@ def invalidate_biometric_token_with_http_info(user_id, token_uuid, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'InvalidatedBiometricTokenSummary' + return_type = opts[:debug_return_type] || 'InvalidatedBiometricTokenResponse' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2ClientCredentials', 'Token'] @@ -3349,7 +3349,7 @@ def invalidate_biometric_token_with_http_info(user_id, token_uuid, opts = {}) # Invalidates every biometric token associated with the supplied customer user ID. # @param user_id [String] Customer user ID whose biometric tokens will be invalidated. # @param [Hash] opts the optional parameters - # @return [InvalidatedBiometricTokensSummary] + # @return [InvalidatedBiometricTokensResponse] def invalidate_biometric_tokens(user_id, opts = {}) data, _status_code, _headers = invalidate_biometric_tokens_with_http_info(user_id, opts) data @@ -3359,7 +3359,7 @@ def invalidate_biometric_tokens(user_id, opts = {}) # Invalidates every biometric token associated with the supplied customer user ID. # @param user_id [String] Customer user ID whose biometric tokens will be invalidated. # @param [Hash] opts the optional parameters - # @return [Array<(InvalidatedBiometricTokensSummary, Integer, Hash)>] InvalidatedBiometricTokensSummary data, response status code and response headers + # @return [Array<(InvalidatedBiometricTokensResponse, Integer, Hash)>] InvalidatedBiometricTokensResponse data, response status code and response headers def invalidate_biometric_tokens_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.invalidate_biometric_tokens ...' @@ -3386,7 +3386,7 @@ def invalidate_biometric_tokens_with_http_info(user_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'InvalidatedBiometricTokensSummary' + return_type = opts[:debug_return_type] || 'InvalidatedBiometricTokensResponse' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2ClientCredentials', 'Token'] @@ -3478,7 +3478,7 @@ def list_applicants_with_http_info(opts = {}) # Returns the biometric tokens associated with the supplied customer user ID. # @param user_id [String] Customer user ID that owns the biometric tokens. # @param [Hash] opts the optional parameters - # @return [BiometricTokensList] + # @return [BiometricTokensResponse] def list_biometric_tokens(user_id, opts = {}) data, _status_code, _headers = list_biometric_tokens_with_http_info(user_id, opts) data @@ -3488,7 +3488,7 @@ def list_biometric_tokens(user_id, opts = {}) # Returns the biometric tokens associated with the supplied customer user ID. # @param user_id [String] Customer user ID that owns the biometric tokens. # @param [Hash] opts the optional parameters - # @return [Array<(BiometricTokensList, Integer, Hash)>] BiometricTokensList data, response status code and response headers + # @return [Array<(BiometricTokensResponse, Integer, Hash)>] BiometricTokensResponse data, response status code and response headers def list_biometric_tokens_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.list_biometric_tokens ...' @@ -3515,7 +3515,7 @@ def list_biometric_tokens_with_http_info(user_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'BiometricTokensList' + return_type = opts[:debug_return_type] || 'BiometricTokensResponse' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2ClientCredentials', 'Token'] @@ -4969,7 +4969,7 @@ def update_applicant_with_http_info(applicant_id, applicant_updater, opts = {}) # @param token_uuid [String] Biometric token UUID. # @param biometric_token_updater [BiometricTokenUpdater] Biometric token update payload. # @param [Hash] opts the optional parameters - # @return [UpdateBiometricToken200Response] + # @return [UpdatedBiometricTokenResponse] def update_biometric_token(user_id, token_uuid, biometric_token_updater, opts = {}) data, _status_code, _headers = update_biometric_token_with_http_info(user_id, token_uuid, biometric_token_updater, opts) data @@ -4981,7 +4981,7 @@ def update_biometric_token(user_id, token_uuid, biometric_token_updater, opts = # @param token_uuid [String] Biometric token UUID. # @param biometric_token_updater [BiometricTokenUpdater] Biometric token update payload. # @param [Hash] opts the optional parameters - # @return [Array<(UpdateBiometricToken200Response, Integer, Hash)>] UpdateBiometricToken200Response data, response status code and response headers + # @return [Array<(UpdatedBiometricTokenResponse, Integer, Hash)>] UpdatedBiometricTokenResponse data, response status code and response headers def update_biometric_token_with_http_info(user_id, token_uuid, biometric_token_updater, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.update_biometric_token ...' @@ -5021,7 +5021,7 @@ def update_biometric_token_with_http_info(user_id, token_uuid, biometric_token_u post_body = opts[:debug_body] || @api_client.object_to_http_body(biometric_token_updater) # return_type - return_type = opts[:debug_return_type] || 'UpdateBiometricToken200Response' + return_type = opts[:debug_return_type] || 'UpdatedBiometricTokenResponse' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2ClientCredentials', 'Token'] diff --git a/lib/onfido/models/biometric_token.rb b/lib/onfido/models/biometric_token.rb index 050f7f7..ec0f374 100644 --- a/lib/onfido/models/biometric_token.rb +++ b/lib/onfido/models/biometric_token.rb @@ -14,13 +14,18 @@ require 'time' module Onfido + # Biometric token. class BiometricToken - attr_accessor :biometric_token + # The biometric token's unique identifier. + attr_accessor :uuid + + attr_accessor :data # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'biometric_token' => :'biometric_token' + :'uuid' => :'uuid', + :'data' => :'data' } end @@ -37,7 +42,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'biometric_token' => :'BiometricToken' + :'uuid' => :'String', + :'data' => :'BiometricTokenData' } end @@ -63,10 +69,16 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'biometric_token') - self.biometric_token = attributes[:'biometric_token'] + if attributes.key?(:'uuid') + self.uuid = attributes[:'uuid'] + else + self.uuid = nil + end + + if attributes.key?(:'data') + self.data = attributes[:'data'] else - self.biometric_token = nil + self.data = nil end end @@ -75,8 +87,12 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @biometric_token.nil? - invalid_properties.push('invalid value for "biometric_token", biometric_token cannot be nil.') + if @uuid.nil? + invalid_properties.push('invalid value for "uuid", uuid cannot be nil.') + end + + if @data.nil? + invalid_properties.push('invalid value for "data", data cannot be nil.') end invalid_properties @@ -86,18 +102,29 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @biometric_token.nil? + return false if @uuid.nil? + return false if @data.nil? true end # Custom attribute writer method with validation - # @param [Object] biometric_token Value to be assigned - def biometric_token=(biometric_token) - if biometric_token.nil? - fail ArgumentError, 'biometric_token cannot be nil' + # @param [Object] uuid Value to be assigned + def uuid=(uuid) + if uuid.nil? + fail ArgumentError, 'uuid cannot be nil' + end + + @uuid = uuid + end + + # Custom attribute writer method with validation + # @param [Object] data Value to be assigned + def data=(data) + if data.nil? + fail ArgumentError, 'data cannot be nil' end - @biometric_token = biometric_token + @data = data end # Checks equality by comparing each attribute. @@ -105,7 +132,8 @@ def biometric_token=(biometric_token) def ==(o) return true if self.equal?(o) self.class == o.class && - biometric_token == o.biometric_token + uuid == o.uuid && + data == o.data end # @see the `==` method @@ -117,7 +145,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [biometric_token].hash + [uuid, data].hash end # Builds the object from hash diff --git a/lib/onfido/models/update_biometric_token200_response.rb b/lib/onfido/models/biometric_token_response.rb similarity index 96% rename from lib/onfido/models/update_biometric_token200_response.rb rename to lib/onfido/models/biometric_token_response.rb index 3148cd0..1961c9a 100644 --- a/lib/onfido/models/update_biometric_token200_response.rb +++ b/lib/onfido/models/biometric_token_response.rb @@ -14,7 +14,7 @@ require 'time' module Onfido - class UpdateBiometricToken200Response + class BiometricTokenResponse attr_accessor :biometric_token # Attribute mapping from ruby-style variable name to JSON key. @@ -51,14 +51,14 @@ 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::UpdateBiometricToken200Response` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::BiometricTokenResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::UpdateBiometricToken200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::BiometricTokenResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/onfido/models/biometric_tokens_list.rb b/lib/onfido/models/biometric_tokens_response.rb similarity index 96% rename from lib/onfido/models/biometric_tokens_list.rb rename to lib/onfido/models/biometric_tokens_response.rb index 3eecc3f..bcb35d0 100644 --- a/lib/onfido/models/biometric_tokens_list.rb +++ b/lib/onfido/models/biometric_tokens_response.rb @@ -14,7 +14,7 @@ require 'time' module Onfido - class BiometricTokensList + class BiometricTokensResponse attr_accessor :biometric_tokens # Attribute mapping from ruby-style variable name to JSON key. @@ -51,14 +51,14 @@ 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::BiometricTokensList` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::BiometricTokensResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::BiometricTokensList`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::BiometricTokensResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/onfido/models/invalidated_biometric_token_response.rb b/lib/onfido/models/invalidated_biometric_token_response.rb new file mode 100644 index 0000000..549662c --- /dev/null +++ b/lib/onfido/models/invalidated_biometric_token_response.rb @@ -0,0 +1,237 @@ +=begin +#Onfido Public API v3.6 + +#The Onfido Public API (v3.6) + +The version of the OpenAPI document: v3.6 + +Generated by: https://openapi-generator.tech +Generator version: 7.16.0 + +=end + +require 'date' +require 'time' + +module Onfido + class InvalidatedBiometricTokenResponse + attr_accessor :biometric_token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'biometric_token' => :'biometric_token' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'biometric_token' => :'InvalidatedBiometricTokenSummary' + } + 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::InvalidatedBiometricTokenResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::InvalidatedBiometricTokenResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'biometric_token') + self.biometric_token = attributes[:'biometric_token'] + else + self.biometric_token = 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 @biometric_token.nil? + invalid_properties.push('invalid value for "biometric_token", biometric_token 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 @biometric_token.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] biometric_token Value to be assigned + def biometric_token=(biometric_token) + if biometric_token.nil? + fail ArgumentError, 'biometric_token cannot be nil' + end + + @biometric_token = biometric_token + 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 && + biometric_token == o.biometric_token + 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 + [biometric_token].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/invalidated_biometric_token_summary.rb b/lib/onfido/models/invalidated_biometric_token_summary.rb index 5ee036f..85943bb 100644 --- a/lib/onfido/models/invalidated_biometric_token_summary.rb +++ b/lib/onfido/models/invalidated_biometric_token_summary.rb @@ -14,13 +14,14 @@ require 'time' module Onfido + # Invalidated biometric tokens response payload. class InvalidatedBiometricTokenSummary - attr_accessor :biometric_token + attr_accessor :deleted_items # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'biometric_token' => :'biometric_token' + :'deleted_items' => :'deleted_items' } end @@ -37,7 +38,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'biometric_token' => :'InvalidatedBiometricTokenSummary' + :'deleted_items' => :'InvalidatedBiometricTokenSummaryDeletedItems' } end @@ -63,10 +64,10 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'biometric_token') - self.biometric_token = attributes[:'biometric_token'] + if attributes.key?(:'deleted_items') + self.deleted_items = attributes[:'deleted_items'] else - self.biometric_token = nil + self.deleted_items = nil end end @@ -75,8 +76,8 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @biometric_token.nil? - invalid_properties.push('invalid value for "biometric_token", biometric_token cannot be nil.') + if @deleted_items.nil? + invalid_properties.push('invalid value for "deleted_items", deleted_items cannot be nil.') end invalid_properties @@ -86,18 +87,18 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @biometric_token.nil? + return false if @deleted_items.nil? true end # Custom attribute writer method with validation - # @param [Object] biometric_token Value to be assigned - def biometric_token=(biometric_token) - if biometric_token.nil? - fail ArgumentError, 'biometric_token cannot be nil' + # @param [Object] deleted_items Value to be assigned + def deleted_items=(deleted_items) + if deleted_items.nil? + fail ArgumentError, 'deleted_items cannot be nil' end - @biometric_token = biometric_token + @deleted_items = deleted_items end # Checks equality by comparing each attribute. @@ -105,7 +106,7 @@ def biometric_token=(biometric_token) def ==(o) return true if self.equal?(o) self.class == o.class && - biometric_token == o.biometric_token + deleted_items == o.deleted_items end # @see the `==` method @@ -117,7 +118,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [biometric_token].hash + [deleted_items].hash end # Builds the object from hash diff --git a/lib/onfido/models/invalidated_biometric_tokens_summary.rb b/lib/onfido/models/invalidated_biometric_tokens_response.rb similarity index 96% rename from lib/onfido/models/invalidated_biometric_tokens_summary.rb rename to lib/onfido/models/invalidated_biometric_tokens_response.rb index 00920b4..6dce777 100644 --- a/lib/onfido/models/invalidated_biometric_tokens_summary.rb +++ b/lib/onfido/models/invalidated_biometric_tokens_response.rb @@ -14,7 +14,7 @@ require 'time' module Onfido - class InvalidatedBiometricTokensSummary + class InvalidatedBiometricTokensResponse attr_accessor :biometric_tokens # Attribute mapping from ruby-style variable name to JSON key. @@ -51,14 +51,14 @@ 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::InvalidatedBiometricTokensSummary` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::InvalidatedBiometricTokensResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::InvalidatedBiometricTokensSummary`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::InvalidatedBiometricTokensResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/onfido/models/updated_biometric_token_response.rb b/lib/onfido/models/updated_biometric_token_response.rb new file mode 100644 index 0000000..c8c986f --- /dev/null +++ b/lib/onfido/models/updated_biometric_token_response.rb @@ -0,0 +1,237 @@ +=begin +#Onfido Public API v3.6 + +#The Onfido Public API (v3.6) + +The version of the OpenAPI document: v3.6 + +Generated by: https://openapi-generator.tech +Generator version: 7.16.0 + +=end + +require 'date' +require 'time' + +module Onfido + class UpdatedBiometricTokenResponse + attr_accessor :biometric_token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'biometric_token' => :'biometric_token' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'biometric_token' => :'BiometricToken' + } + 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::UpdatedBiometricTokenResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::UpdatedBiometricTokenResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'biometric_token') + self.biometric_token = attributes[:'biometric_token'] + else + self.biometric_token = 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 @biometric_token.nil? + invalid_properties.push('invalid value for "biometric_token", biometric_token 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 @biometric_token.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] biometric_token Value to be assigned + def biometric_token=(biometric_token) + if biometric_token.nil? + fail ArgumentError, 'biometric_token cannot be nil' + end + + @biometric_token = biometric_token + 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 && + biometric_token == o.biometric_token + 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 + [biometric_token].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