Skip to content

Commit

Permalink
Merge pull request #49 from onfido/release-upgrade
Browse files Browse the repository at this point in the history
Refresh onfido-ruby after onfido-openapi-spec update (ef28a11)
  • Loading branch information
RiccardoPetteruti-Onfido authored May 16, 2024
2 parents 200f82d + dbbf5c9 commit 470a341
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 20 deletions.
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v3.0.0 31th May 2024

- Make library auto-generated and based on [Onfido OpenAPI spec](https://github.com/onfido/onfido-openapi-spec)

## v2.9.0 24 November 2023

- Added `signed_evidence_file` method for WorkflowRuns
Expand All @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand All @@ -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](<https://github.com/onfido/onfido-ruby/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'`)
Expand All @@ -102,5 +102,6 @@ For contributions to the tests instead, please follow the steps below:
More documentation and code examples can be found at <https://documentation.onfido.com>.

## 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.
2 changes: 1 addition & 1 deletion lib/onfido.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions lib/onfido/api/default_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ...'
Expand Down Expand Up @@ -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']
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/2.9.0"
@user_agent = "onfido-ruby/3.0.0"
@default_headers = {
'Content-Type' => 'application/json',
'User-Agent' => @user_agent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
}
Expand Down
21 changes: 21 additions & 0 deletions lib/onfido/models/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}.")
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions onfido.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}

Expand Down

0 comments on commit 470a341

Please sign in to comment.