diff --git a/CHANGELOG.md b/CHANGELOG.md index 2038ec5..1139080 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v3.0.0 15th May 2024 + +- Refresh library up to commit: [ef28a11](https://github.com/onfido/onfido-openapi-spec/commit/ef28a11bfaa531784d3c961807643617fba3a827) + ## v2.9.0 24 November 2023 - Added `signed_evidence_file` method for WorkflowRuns @@ -23,11 +27,11 @@ ## v2.4.0, 05 October 2022 -- Updated to use API v3.5, for more details please see our [release notes](https://developers.onfido.com/release-notes#api-v35). +- Updated to use API v3.5, for more details please see our [release notes](https://developers.onfido.com/release-notes#api-v35). ## v2.3.0, 02 March 2022 -- Updated to use API v3.4, for more details please see our [release notes](https://developers.onfido.com/release-notes#api-v34). +- Updated to use API v3.4, for more details please see our [release notes](https://developers.onfido.com/release-notes#api-v34). ## v2.2.0, 02 March 2022 @@ -94,7 +98,7 @@ ## v0.11.0, 18 April 2018 - Automatically detect the correct Onfido API region to use based on the provided API -key (#49) (@tpinto) + key (#49) (@tpinto) ## v0.10.0, 3 April 2018 @@ -108,7 +112,7 @@ key (#49) (@tpinto) ## v0.8.4, 29 January 2018 - Replace use of `method_missing` with explicitly-defined accessors when accessing -resources from an `Onfido::API` instance (@hmac) + resources from an `Onfido::API` instance (@hmac) ## v0.8.3, 16 January 2018 diff --git a/README.md b/README.md index 19502ed..26f1d18 100644 --- a/README.md +++ b/README.md @@ -78,9 +78,9 @@ Webhook events payload needs to be verified before it can be accessed. Library a event = verifier.read_payload('{"payload":{"r...3"}}', signature) rescue Onfido::OnfidoInvalidSignatureError => e - e.type - e.fields - e.response_code + e.type + e.fields + e.response_code end ``` @@ -90,7 +90,7 @@ This library is automatically generated using [OpenAPI Generator](https://openap For contributions to the tests instead, please follow the steps below: -1. [Fork]() repository +1. [Fork](https://github.com/onfido/onfido-ruby/fork) repository 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Make your changes 4. Commit your changes (`git commit -am 'Add some feature'`) @@ -102,5 +102,6 @@ For contributions to the tests instead, please follow the steps below: More documentation and code examples can be found at . ## Support + Should you encounter any technical issues during integration, please contact Onfido's Customer Support team via the [Customer Experience Portal](https://public.support.onfido.com/) which also includes support documentation. diff --git a/lib/onfido.rb b/lib/onfido.rb index 3f8abdd..c1a5fa2 100644 --- a/lib/onfido.rb +++ b/lib/onfido.rb @@ -197,7 +197,7 @@ require 'onfido/models/live_photo_response' require 'onfido/models/live_photos_list' require 'onfido/models/live_video' -require 'onfido/models/liveo_videos_list' +require 'onfido/models/live_videos_list' require 'onfido/models/location' require 'onfido/models/location_builder' require 'onfido/models/location_shared' diff --git a/lib/onfido/api/default_api.rb b/lib/onfido/api/default_api.rb index eeceb73..c115fa7 100644 --- a/lib/onfido/api/default_api.rb +++ b/lib/onfido/api/default_api.rb @@ -2672,7 +2672,7 @@ def list_live_photos_with_http_info(applicant_id, opts = {}) # Lists all the live videos that belong to an applicant. # @param applicant_id [String] The id of the applicant the live videos belong to. # @param [Hash] opts the optional parameters - # @return [LiveoVideosList] + # @return [LiveVideosList] def list_live_videos(applicant_id, opts = {}) data, _status_code, _headers = list_live_videos_with_http_info(applicant_id, opts) data @@ -2682,7 +2682,7 @@ def list_live_videos(applicant_id, opts = {}) # Lists all the live videos that belong to an applicant. # @param applicant_id [String] The id of the applicant the live videos belong to. # @param [Hash] opts the optional parameters - # @return [Array<(LiveoVideosList, Integer, Hash)>] LiveoVideosList data, response status code and response headers + # @return [Array<(LiveVideosList, Integer, Hash)>] LiveVideosList data, response status code and response headers def list_live_videos_with_http_info(applicant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.list_live_videos ...' @@ -2710,7 +2710,7 @@ def list_live_videos_with_http_info(applicant_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'LiveoVideosList' + return_type = opts[:debug_return_type] || 'LiveVideosList' # auth_names auth_names = opts[:debug_auth_names] || ['Token'] diff --git a/lib/onfido/api_client.rb b/lib/onfido/api_client.rb index c11aba4..6febeb4 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/2.9.0" + @user_agent = "onfido-ruby/3.0.0" @default_headers = { 'Content-Type' => 'application/json', 'User-Agent' => @user_agent diff --git a/lib/onfido/models/liveo_videos_list.rb b/lib/onfido/models/live_videos_list.rb similarity index 96% rename from lib/onfido/models/liveo_videos_list.rb rename to lib/onfido/models/live_videos_list.rb index 7d0cbab..666301f 100644 --- a/lib/onfido/models/liveo_videos_list.rb +++ b/lib/onfido/models/live_videos_list.rb @@ -14,7 +14,7 @@ require 'time' module Onfido - class LiveoVideosList + class LiveVideosList attr_accessor :live_videos # 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::LiveoVideosList` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::LiveVideosList` 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::LiveoVideosList`. 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::LiveVideosList`. 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 8d937be..74d810f 100644 --- a/lib/onfido/models/task.rb +++ b/lib/onfido/models/task.rb @@ -95,6 +95,11 @@ 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-_]+$/) + 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-_]+$/) if !@task_def_id.nil? && @task_def_id !~ pattern invalid_properties.push("invalid value for \"task_def_id\", must conform to the pattern #{pattern}.") @@ -107,10 +112,26 @@ 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-_]+$/) true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + pattern = Regexp.new(/^[0-9a-z-_]+$/) + if id !~ pattern + fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}." + end + + @id = id + end + # Custom attribute writer method with validation # @param [Object] task_def_id Value to be assigned def task_def_id=(task_def_id) diff --git a/onfido.gemspec b/onfido.gemspec index 6c2445d..0b36db8 100644 --- a/onfido.gemspec +++ b/onfido.gemspec @@ -21,10 +21,10 @@ Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.authors = ["OpenAPI-Generator"] s.email = [""] - s.homepage = "https://openapi-generator.tech" - s.summary = "Onfido API v3.6 Ruby Gem" - s.description = "The Onfido API (v3.6)" - s.license = "Unlicense" + s.homepage = "https://github.com/onfido/onfido-ruby" + s.summary = "The official Ruby library for integrating with the Onfido API." + s.description = "Ruby Library for the Onfido API" + s.license = "MIT" s.required_ruby_version = ">= 2.7" s.metadata = {}