diff --git a/README.md b/README.md index 26f1d18..9f2ce60 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Configure with your API token, region and optional timeout (default value is 30) require onfido Onfido.configure do |config| - config.api_token = ENV["ONFIDO_API_TOKEN"] + config.api_token = ENV["ONFIDO_WEBHOOK_SECRET_TOKEN"] config.region = config.region[:EU] config.timeout = 30 end diff --git a/lib/onfido.rb b/lib/onfido.rb index d9b97a3..233c3e1 100644 --- a/lib/onfido.rb +++ b/lib/onfido.rb @@ -158,10 +158,10 @@ require 'onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown_liveness_detected' require 'onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown_spoofing_detection' require 'onfido/models/facial_similarity_video_report' -require 'onfido/models/id_photos_list' require 'onfido/models/id_number' require 'onfido/models/id_photo' require 'onfido/models/id_photo_response' +require 'onfido/models/id_photos_list' require 'onfido/models/identity_enhanced_breakdown' require 'onfido/models/identity_enhanced_breakdown_address' require 'onfido/models/identity_enhanced_breakdown_address_breakdown' diff --git a/lib/onfido/api/default_api.rb b/lib/onfido/api/default_api.rb index ffcfa5d..1405576 100644 --- a/lib/onfido/api/default_api.rb +++ b/lib/onfido/api/default_api.rb @@ -2676,7 +2676,7 @@ def list_documents_with_http_info(applicant_id, opts = {}) # Lists the ID photos that belong to an applicant. # @param applicant_id [String] The id of the applicant the ID photos belong to. # @param [Hash] opts the optional parameters - # @return [IDPhotosList] + # @return [IdPhotosList] def list_id_photos(applicant_id, opts = {}) data, _status_code, _headers = list_id_photos_with_http_info(applicant_id, opts) data @@ -2686,7 +2686,7 @@ def list_id_photos(applicant_id, opts = {}) # Lists the ID photos that belong to an applicant. # @param applicant_id [String] The id of the applicant the ID photos belong to. # @param [Hash] opts the optional parameters - # @return [Array<(IDPhotosList, Integer, Hash)>] IDPhotosList data, response status code and response headers + # @return [Array<(IdPhotosList, Integer, Hash)>] IdPhotosList data, response status code and response headers def list_id_photos_with_http_info(applicant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.list_id_photos ...' @@ -2714,7 +2714,7 @@ def list_id_photos_with_http_info(applicant_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IDPhotosList' + return_type = opts[:debug_return_type] || 'IdPhotosList' # auth_names auth_names = opts[:debug_auth_names] || ['Token'] diff --git a/lib/onfido/models/id_photos_list.rb b/lib/onfido/models/id_photos_list.rb index 119629b..526a2e7 100644 --- a/lib/onfido/models/id_photos_list.rb +++ b/lib/onfido/models/id_photos_list.rb @@ -14,7 +14,7 @@ require 'time' module Onfido - class IDPhotosList + class IdPhotosList attr_accessor :id_photos # Attribute mapping from ruby-style variable name to JSON key. @@ -46,13 +46,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::IDPhotosList` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::IdPhotosList` 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::IDPhotosList`. 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::IdPhotosList`. 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 } diff --git a/lib/onfido/models/task.rb b/lib/onfido/models/task.rb index bb5e256..097a234 100644 --- a/lib/onfido/models/task.rb +++ b/lib/onfido/models/task.rb @@ -133,12 +133,12 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - pattern = Regexp.new(/^[0-9a-z-_]+$/) + pattern = Regexp.new(/^[0-9a-z_-]+$/) if !@id.nil? && @id !~ pattern invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.") end - pattern = Regexp.new(/^[0-9a-z-_]+$/) + pattern = Regexp.new(/^[0-9a-z_-]+$/) if !@task_def_id.nil? && @task_def_id !~ pattern invalid_properties.push("invalid value for \"task_def_id\", must conform to the pattern #{pattern}.") end @@ -150,8 +150,8 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@id.nil? && @id !~ Regexp.new(/^[0-9a-z-_]+$/) - return false if !@task_def_id.nil? && @task_def_id !~ Regexp.new(/^[0-9a-z-_]+$/) + return false if !@id.nil? && @id !~ Regexp.new(/^[0-9a-z_-]+$/) + return false if !@task_def_id.nil? && @task_def_id !~ Regexp.new(/^[0-9a-z_-]+$/) true end @@ -162,7 +162,7 @@ def id=(id) fail ArgumentError, 'id cannot be nil' end - pattern = Regexp.new(/^[0-9a-z-_]+$/) + pattern = Regexp.new(/^[0-9a-z_-]+$/) if id !~ pattern fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}." end @@ -177,7 +177,7 @@ def task_def_id=(task_def_id) fail ArgumentError, 'task_def_id cannot be nil' end - pattern = Regexp.new(/^[0-9a-z-_]+$/) + pattern = Regexp.new(/^[0-9a-z_-]+$/) if task_def_id !~ pattern fail ArgumentError, "invalid value for \"task_def_id\", must conform to the pattern #{pattern}." end diff --git a/lib/onfido/models/task_item.rb b/lib/onfido/models/task_item.rb index 271d077..8824888 100644 --- a/lib/onfido/models/task_item.rb +++ b/lib/onfido/models/task_item.rb @@ -95,12 +95,12 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - pattern = Regexp.new(/^[0-9a-z-_]+$/) + pattern = Regexp.new(/^[0-9a-z_-]+$/) if !@id.nil? && @id !~ pattern invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.") end - pattern = Regexp.new(/^[0-9a-z-_]+$/) + pattern = Regexp.new(/^[0-9a-z_-]+$/) if !@task_def_id.nil? && @task_def_id !~ pattern invalid_properties.push("invalid value for \"task_def_id\", must conform to the pattern #{pattern}.") end @@ -112,8 +112,8 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@id.nil? && @id !~ Regexp.new(/^[0-9a-z-_]+$/) - return false if !@task_def_id.nil? && @task_def_id !~ Regexp.new(/^[0-9a-z-_]+$/) + return false if !@id.nil? && @id !~ Regexp.new(/^[0-9a-z_-]+$/) + return false if !@task_def_id.nil? && @task_def_id !~ Regexp.new(/^[0-9a-z_-]+$/) true end @@ -124,7 +124,7 @@ def id=(id) fail ArgumentError, 'id cannot be nil' end - pattern = Regexp.new(/^[0-9a-z-_]+$/) + pattern = Regexp.new(/^[0-9a-z_-]+$/) if id !~ pattern fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}." end @@ -139,7 +139,7 @@ def task_def_id=(task_def_id) fail ArgumentError, 'task_def_id cannot be nil' end - pattern = Regexp.new(/^[0-9a-z-_]+$/) + pattern = Regexp.new(/^[0-9a-z_-]+$/) if task_def_id !~ pattern fail ArgumentError, "invalid value for \"task_def_id\", must conform to the pattern #{pattern}." end