Skip to content

Commit

Permalink
Merge pull request #66 from onfido/release-upgrade
Browse files Browse the repository at this point in the history
Refresh onfido-ruby after onfido-openapi-spec update (10f8380)
  • Loading branch information
dvacca-onfido authored Oct 22, 2024
2 parents d7ead84 + 21f705b commit 9238f39
Show file tree
Hide file tree
Showing 42 changed files with 871 additions and 416 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
release:
types:
- published
schedule:
- cron: "0 16 * * 0" # Every Sunday, 4 hours after midday

jobs:
integration-tests:
Expand Down
6 changes: 3 additions & 3 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": "08508b9",
"long_sha": "08508b9517238b3becb4265130633a418a8ee319",
"version": "v3.5.0"
"short_sha": "10f8380",
"long_sha": "10f83806efa080edbf022ac48d5eeac90fbceb0c",
"version": ""
},
"release": "v3.4.0"
}
13 changes: 9 additions & 4 deletions lib/onfido.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
require 'onfido/models/addresses_list'
require 'onfido/models/applicant'
require 'onfido/models/applicant_builder'
require 'onfido/models/applicant_consent_builder'
require 'onfido/models/applicant_consent_name'
require 'onfido/models/applicant_create'
require 'onfido/models/applicant_request'
require 'onfido/models/applicant_response'
Expand All @@ -35,11 +37,10 @@
require 'onfido/models/check_request'
require 'onfido/models/check_response'
require 'onfido/models/check_shared'
require 'onfido/models/check_status'
require 'onfido/models/checks_list'
require 'onfido/models/complete_task_builder'
require 'onfido/models/complete_task_data_builder'
require 'onfido/models/consent_item'
require 'onfido/models/consents_builder'
require 'onfido/models/country_codes'
require 'onfido/models/device_intelligence_breakdown'
require 'onfido/models/device_intelligence_breakdown_breakdown'
Expand Down Expand Up @@ -283,8 +284,11 @@
require 'onfido/models/webhook_builder'
require 'onfido/models/webhook_create'
require 'onfido/models/webhook_event'
require 'onfido/models/webhook_event_object_status'
require 'onfido/models/webhook_event_payload'
require 'onfido/models/webhook_event_payload_object'
require 'onfido/models/webhook_event_payload_resource'
require 'onfido/models/webhook_event_resource_type'
require 'onfido/models/webhook_event_type'
require 'onfido/models/webhook_resend'
require 'onfido/models/webhook_response'
Expand All @@ -295,11 +299,12 @@
require 'onfido/models/webhooks_resend_item'
require 'onfido/models/workflow_run'
require 'onfido/models/workflow_run_builder'
require 'onfido/models/workflow_run_error'
require 'onfido/models/workflow_run_link'
require 'onfido/models/workflow_run_request'
require 'onfido/models/workflow_run_response'
require 'onfido/models/workflow_run_response_error'
require 'onfido/models/workflow_run_shared'
require 'onfido/models/workflow_run_shared_link'
require 'onfido/models/workflow_run_status'

# APIs
require 'onfido/api/default_api'
Expand Down
4 changes: 2 additions & 2 deletions lib/onfido/api/default_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4058,7 +4058,7 @@ def update_webhook_with_http_info(webhook_id, webhook_updater, opts = {})

# Upload a document
# Documents are uploaded using this endpoint. Along with the file upload the relevant document type must be specified. Documents must be uploaded as a multipart form. The valid file types are: jpg, png and pdf. The file size must be between 2KB and 3MB.
# @param type [String] The type of document
# @param type [DocumentTypes] The type of document
# @param applicant_id [String] The ID of the applicant whose document is being uploaded.
# @param file [File] The file to be uploaded.
# @param [Hash] opts the optional parameters
Expand All @@ -4075,7 +4075,7 @@ def upload_document(type, applicant_id, file, opts = {})

# Upload a document
# Documents are uploaded using this endpoint. Along with the file upload the relevant document type must be specified. Documents must be uploaded as a multipart form. The valid file types are: jpg, png and pdf. The file size must be between 2KB and 3MB.
# @param type [String] The type of document
# @param type [DocumentTypes] The type of document
# @param applicant_id [String] The ID of the applicant whose document is being uploaded.
# @param file [File] The file to be uploaded.
# @param [Hash] opts the optional parameters
Expand Down
7 changes: 5 additions & 2 deletions lib/onfido/models/applicant_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ApplicantBuilder
# The applicant's phone number
attr_accessor :phone_number

# The applicant's consents
attr_accessor :consents

attr_accessor :address
Expand Down Expand Up @@ -65,7 +66,7 @@ def self.openapi_types
:'dob' => :'Date',
:'id_numbers' => :'Array<IdNumber>',
:'phone_number' => :'String',
:'consents' => :'ConsentsBuilder',
:'consents' => :'Array<ApplicantConsentBuilder>',
:'address' => :'AddressBuilder',
:'location' => :'LocationBuilder',
:'first_name' => :'String',
Expand Down Expand Up @@ -122,7 +123,9 @@ def initialize(attributes = {})
end

if attributes.key?(:'consents')
self.consents = attributes[:'consents']
if (value = attributes[:'consents']).is_a?(Array)
self.consents = value
end
end

if attributes.key?(:'address')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
require 'time'

module Onfido
# The applicant's consents
class ConsentItem
class ApplicantConsentBuilder
attr_accessor :name

attr_accessor :granted
Expand Down Expand Up @@ -58,7 +57,7 @@ def self.acceptable_attributes
# Attribute type mapping.
def self.openapi_types
{
:'name' => :'String',
:'name' => :'ApplicantConsentName',
:'granted' => :'Boolean'
}
end
Expand All @@ -73,13 +72,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::ConsentItem` initialize method"
fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::ApplicantConsentBuilder` 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::ConsentItem`. 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::ApplicantConsentBuilder`. 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 Expand Up @@ -118,22 +117,10 @@ def list_invalid_properties
def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
return false if @name.nil?
name_validator = EnumAttributeValidator.new('String', ["privacy_notices_read", "ssn_verification", "phone_number_verification", "unknown_default_open_api"])
return false unless name_validator.valid?(@name)
return false if @granted.nil?
true
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] name Object to be assigned
def name=(name)
validator = EnumAttributeValidator.new('String', ["privacy_notices_read", "ssn_verification", "phone_number_verification", "unknown_default_open_api"])
unless validator.valid?(name)
fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}."
end
@name = name
end

# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
Expand Down
42 changes: 42 additions & 0 deletions lib/onfido/models/applicant_consent_name.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
=begin
#Onfido API v3.6
#The Onfido API (v3.6)
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
=end

require 'date'
require 'time'

module Onfido
class ApplicantConsentName
PRIVACY_NOTICES_READ = "privacy_notices_read".freeze
SSN_VERIFICATION = "ssn_verification".freeze
PHONE_NUMBER_VERIFICATION = "phone_number_verification".freeze
UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze

def self.all_vars
@all_vars ||= [PRIVACY_NOTICES_READ, SSN_VERIFICATION, PHONE_NUMBER_VERIFICATION, UNKNOWN_DEFAULT_OPEN_API].freeze
end

# Builds the enum from string
# @param [String] The enum value in the form of the string
# @return [String] The enum value
def self.build_from_hash(value)
new.build_from_hash(value)
end

# Builds the enum from string
# @param [String] The enum value in the form of the string
# @return [String] The enum value
def build_from_hash(value)
return value if ApplicantConsentName.all_vars.include?(value)
raise "Invalid ENUM value #{value} for class #ApplicantConsentName"
end
end
end
7 changes: 5 additions & 2 deletions lib/onfido/models/applicant_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

module Onfido
class ApplicantRequest
# The applicant's consents
attr_accessor :consents

attr_accessor :address
Expand All @@ -38,7 +39,7 @@ def self.acceptable_attributes
# Attribute type mapping.
def self.openapi_types
{
:'consents' => :'ConsentsBuilder',
:'consents' => :'Array<ApplicantConsentBuilder>',
:'address' => :'AddressBuilder',
:'location' => :'LocationBuilder'
}
Expand Down Expand Up @@ -66,7 +67,9 @@ def initialize(attributes = {})
}

if attributes.key?(:'consents')
self.consents = attributes[:'consents']
if (value = attributes[:'consents']).is_a?(Array)
self.consents = value
end
end

if attributes.key?(:'address')
Expand Down
7 changes: 5 additions & 2 deletions lib/onfido/models/applicant_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ApplicantUpdater
# The applicant's phone number
attr_accessor :phone_number

# The applicant's consents
attr_accessor :consents

attr_accessor :address
Expand Down Expand Up @@ -65,7 +66,7 @@ def self.openapi_types
:'dob' => :'Date',
:'id_numbers' => :'Array<IdNumber>',
:'phone_number' => :'String',
:'consents' => :'ConsentsBuilder',
:'consents' => :'Array<ApplicantConsentBuilder>',
:'address' => :'AddressBuilder',
:'location' => :'LocationBuilder',
:'first_name' => :'String',
Expand Down Expand Up @@ -122,7 +123,9 @@ def initialize(attributes = {})
end

if attributes.key?(:'consents')
self.consents = attributes[:'consents']
if (value = attributes[:'consents']).is_a?(Array)
self.consents = value
end
end

if attributes.key?(:'address')
Expand Down
Loading

0 comments on commit 9238f39

Please sign in to comment.