Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh onfido-ruby after onfido-openapi-spec update (be823e7) #74

Merged
merged 2 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .release.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"source": {
"repo_url": "https://github.com/onfido/onfido-openapi-spec",
"short_sha": "54ce45f",
"long_sha": "54ce45f2138f044cc5cb40f6904dc7bc1a675be6",
"version": "v4.5.0"
"short_sha": "be823e7",
"long_sha": "be823e7815c93bfbfc3fb764c0548f57cb851fe9",
"version": "v4.6.0"
},
"release": "v4.5.0"
"release": "v4.6.0"
}
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The official Ruby library for integrating with the Onfido API.

Documentation can be found at <https://documentation.onfido.com>.
Refer to the documentation at <https://documentation.onfido.com>.

This version uses Onfido API v3.6. Refer to our [API versioning guide](https://developers.onfido.com/guide/api-versioning-policy#client-libraries) for details of which client library versions use which versions of the API.

Expand All @@ -14,7 +14,7 @@ This version uses Onfido API v3.6. Refer to our [API versioning guide](https://d
### Installation

```ruby
gem onfido, '~> 4.5.0'
gem onfido, '~> 4.6.0'
```

Configure with your API token, region and optional timeout (default value is 30):
Expand Down Expand Up @@ -42,7 +42,7 @@ applicant = onfido_api.create_applicant(
)
```

Documentation and code examples can be found at https://documentation.onfido.com
Documentation and code examples can be found at <https://documentation.onfido.com>.

## Error Handling

Expand All @@ -65,7 +65,7 @@ end

### Webhook event verification

Webhook events payload needs to be verified before it can be accessed. Library allows to easily decode the payload and verify its signature before returning it as an object for user convenience:
Webhook events payload needs to be verified before it can be accessed. Verifying webhook payloads is crucial for security reasons, as it ensures that the payloads are indeed from Onfido and have not been tampered with. The library allows you to easily decode the payload and verify its signature before returning it as an object for user convenience:

```ruby
require 'onfido/webhook_event_verifier'
Expand All @@ -86,37 +86,39 @@ Webhook events payload needs to be verified before it can be accessed. Library a

## Contributing

This library is automatically generated using [OpenAPI Generator](https://openapi-generator.tech) (version: 7.9.0); therefore all the contributions, except tests files, should target [Onfido OpenAPI specification repository](https://github.com/onfido/onfido-openapi-spec/tree/master) instead of this repository.
This library is automatically generated using [OpenAPI Generator](https://openapi-generator.tech) (version: 7.9.0); therefore, all contributions (except test files) should target the [Onfido OpenAPI specification repository](https://github.com/onfido/onfido-openapi-spec/tree/master) instead of this repository. Please follow the contribution guidelines provided in the OpenAPI specification repository.

For contributions to the tests instead, please follow the steps below:

1. [Fork](https://github.com/onfido/onfido-ruby/fork) repository
1. Fork the [repository](https://github.com/onfido/onfido-ruby/fork)
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'`)
4. Commit your changes (`git commit -am 'Add detailed description of the feature'`)
5. Push to the branch (`git push origin my-new-feature`)
6. Create a new Pull Request

## Versioning policy

[Semantic Versioning](https://semver.org) policy is used for library versioning, following guidelines and limitations below:
Versioning helps manage changes and ensures compatibility across different versions of the library.

- MAJOR versions (x.0.0) might:
[Semantic Versioning](https://semver.org) policy is used for library versioning, following the guidelines and limitations outlined below:

- MAJOR versions (x.0.0) may:
- target a new API version
- include non-backward compatible change
- MINOR versions (0.x.0) might:
- MINOR versions (0.x.0) may:
- add a new functionality, non-mandatory parameter or property
- deprecate an old functionality
- include non-backward compatible change to a functionality which is:
- labelled as alpha or beta
- completely broken and not usable
- PATCH version (0.0.x) might:
- PATCH version (0.0.x) will:
- fix a bug
- include backward compatible changes only

## More documentation

More documentation and code examples can be found at <https://documentation.onfido.com>.
Additional documentation and code examples can be found at <https://documentation.onfido.com>.

## Support

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/4.5.0"
@user_agent = "onfido-ruby/4.6.0"
@default_headers = {
'Content-Type' => 'application/json',
'User-Agent' => @user_agent
Expand Down
4 changes: 2 additions & 2 deletions lib/onfido/models/id_number.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ def list_invalid_properties
# @return true if the model is valid
def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
type_validator = EnumAttributeValidator.new('String', ["ssn", "social_insurance", "tax_id", "identity_card", "driving_licence", "share_code", "voter_id", "passport", "other", "unknown_default_open_api"])
type_validator = EnumAttributeValidator.new('String', ["ssn", "social_insurance", "tax_id", "identity_card", "driving_license", "driving_licence", "share_code", "voter_id", "passport", "other", "unknown_default_open_api"])
return false unless type_validator.valid?(@type)
true
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] type Object to be assigned
def type=(type)
validator = EnumAttributeValidator.new('String', ["ssn", "social_insurance", "tax_id", "identity_card", "driving_licence", "share_code", "voter_id", "passport", "other", "unknown_default_open_api"])
validator = EnumAttributeValidator.new('String', ["ssn", "social_insurance", "tax_id", "identity_card", "driving_license", "driving_licence", "share_code", "voter_id", "passport", "other", "unknown_default_open_api"])
unless validator.valid?(type)
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
end
Expand Down
37 changes: 33 additions & 4 deletions lib/onfido/models/webhook_event_payload_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class WebhookEventPayloadResource
# Error object that details why a Workflow Run is in Error status.
attr_accessor :error

# Customer-provided user identifier.
attr_accessor :customer_user_id

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
Expand All @@ -77,7 +80,8 @@ def self.attribute_map
:'output' => :'output',
:'reasons' => :'reasons',
:'link' => :'link',
:'error' => :'error'
:'error' => :'error',
:'customer_user_id' => :'customer_user_id'
}
end

Expand All @@ -103,7 +107,8 @@ def self.openapi_types
:'output' => :'Object',
:'reasons' => :'Array<String>',
:'link' => :'WorkflowRunLink',
:'error' => :'WorkflowRunError'
:'error' => :'WorkflowRunError',
:'customer_user_id' => :'String'
}
end

Expand Down Expand Up @@ -191,6 +196,10 @@ def initialize(attributes = {})
if attributes.key?(:'error')
self.error = attributes[:'error']
end

if attributes.key?(:'customer_user_id')
self.customer_user_id = attributes[:'customer_user_id']
end
end

# Show invalid properties with the reasons. Usually used together with valid?
Expand All @@ -203,6 +212,10 @@ def list_invalid_properties
invalid_properties.push("invalid value for \"task_def_id\", must conform to the pattern #{pattern}.")
end

if !@customer_user_id.nil? && @customer_user_id.to_s.length > 256
invalid_properties.push('invalid value for "customer_user_id", the character length must be smaller than or equal to 256.')
end

invalid_properties
end

Expand All @@ -211,6 +224,7 @@ def list_invalid_properties
def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
return false if !@task_def_id.nil? && @task_def_id !~ Regexp.new(/^[0-9a-z_-]+$/)
return false if !@customer_user_id.nil? && @customer_user_id.to_s.length > 256
true
end

Expand All @@ -229,6 +243,20 @@ def task_def_id=(task_def_id)
@task_def_id = task_def_id
end

# Custom attribute writer method with validation
# @param [Object] customer_user_id Value to be assigned
def customer_user_id=(customer_user_id)
if customer_user_id.nil?
fail ArgumentError, 'customer_user_id cannot be nil'
end

if customer_user_id.to_s.length > 256
fail ArgumentError, 'invalid value for "customer_user_id", the character length must be smaller than or equal to 256.'
end

@customer_user_id = customer_user_id
end

# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
Expand All @@ -248,7 +276,8 @@ def ==(o)
output == o.output &&
reasons == o.reasons &&
link == o.link &&
error == o.error
error == o.error &&
customer_user_id == o.customer_user_id
end

# @see the `==` method
Expand All @@ -260,7 +289,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[id, applicant_id, created_at, updated_at, dashboard_url, workflow_id, workflow_run_id, workflow_version_id, task_def_id, task_def_version, input, output, reasons, link, error].hash
[id, applicant_id, created_at, updated_at, dashboard_url, workflow_id, workflow_run_id, workflow_version_id, task_def_id, task_def_version, input, output, reasons, link, error, customer_user_id].hash
end

# Builds the object from hash
Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
=end

module Onfido
VERSION = '4.5.0'
VERSION = '4.6.0'
end
Loading