Skip to content

Commit

Permalink
Test generator upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
dvacca-onfido committed Oct 17, 2024
1 parent d7ead84 commit 9504ccf
Show file tree
Hide file tree
Showing 292 changed files with 496 additions and 395 deletions.
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.6.0
7.9.0
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ 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.6.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 the contributions, except tests files, should target [Onfido OpenAPI specification repository](https://github.com/onfido/onfido-openapi-spec/tree/master) instead of this repository.

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

Expand Down Expand Up @@ -121,3 +121,4 @@ More documentation and code examples can be found at <https://documentation.onfi
## 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 @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down
132 changes: 66 additions & 66 deletions lib/onfido/api/default_api.rb

Large diffs are not rendered by default.

54 changes: 30 additions & 24 deletions lib/onfido/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down Expand Up @@ -164,35 +164,41 @@ def download_file(request)
request.options.on_data = Proc.new do |chunk, overall_received_bytes|
stream << chunk
end

stream
end

def deserialize_file(response, stream)
body = response.body
if @config.return_binary_data == true
# return byte stream
encoding = body.encoding
stream.join.force_encoding(encoding)
body = response.body
encoding = body.encoding

# reconstruct content
content = stream.join
content = content.unpack('m').join if response.headers['Content-Transfer-Encoding'] == 'binary'
content = content.force_encoding(encoding)

# return byte stream
return content if @config.return_binary_data == true

# return file instead of binary data
content_disposition = response.headers['Content-Disposition']
if content_disposition && content_disposition =~ /filename=/i
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
prefix = sanitize_filename(filename)
else
# return file instead of binary data
content_disposition = response.headers['Content-Disposition']
if content_disposition && content_disposition =~ /filename=/i
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
prefix = sanitize_filename(filename)
else
prefix = 'download-'
end
prefix = prefix + '-' unless prefix.end_with?('-')
encoding = body.encoding
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
tempfile.write(stream.join.force_encoding(encoding))
tempfile.close
config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
"explicitly with `tempfile.delete`"
tempfile
prefix = 'download-'
end
prefix = prefix + '-' unless prefix.end_with?('-')

tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
tempfile.write(content)
tempfile.close

config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
"explicitly with `tempfile.delete`"
tempfile
end

def connection(opts)
Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/api_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down
14 changes: 12 additions & 2 deletions lib/onfido/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down Expand Up @@ -87,6 +87,14 @@ class Configuration
# @return [true, false]
attr_accessor :debugging

# Set this to ignore operation servers for the API client. This is useful when you need to
# send requests to a different server than the one specified in the OpenAPI document.
# Will default to the base url defined in the spec but can be overridden by setting
# `scheme`, `host`, `base_path` directly.
# Default to false.
# @return [true, false]
attr_accessor :ignore_operation_servers

# Defines the logger used for debugging.
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
#
Expand Down Expand Up @@ -178,6 +186,7 @@ def initialize
@return_binary_data = false
@params_encoder = nil
@debugging = false
@ignore_operation_servers = false
@inject_format = false
@force_ending_format = false
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
Expand Down Expand Up @@ -214,6 +223,7 @@ def base_path=(base_path)

# Returns base URL for specified operation based on server settings
def base_url(operation = nil)
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
if operation_server_settings.key?(operation) then
index = server_operation_index.fetch(operation, server_index)
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
Expand Down Expand Up @@ -270,7 +280,7 @@ def auth_settings
type: 'api_key',
in: 'header',
key: 'Authorization',
value: api_key_with_prefix('Token')
value: api_key_with_prefix('Authorization')
},
}
end
Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/models/address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/models/address_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/models/address_shared.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/models/addresses_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/models/applicant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/models/applicant_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/models/applicant_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/models/applicant_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/models/applicant_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/models/applicant_shared.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/models/applicant_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/models/applicant_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/models/applicants_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand Down
37 changes: 32 additions & 5 deletions lib/onfido/models/check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: v3.6
Generated by: https://openapi-generator.tech
Generator version: 7.6.0
Generator version: 7.9.0
=end

Expand All @@ -30,6 +30,8 @@ class Check
# For checks where `applicant_provides_data` is `true`, redirect to this URI when the applicant has submitted their data.
attr_accessor :redirect_uri

attr_accessor :privacy_notices_read_consent_given

# The unique identifier for the check.
attr_accessor :id

Expand Down Expand Up @@ -57,6 +59,10 @@ class Check
# Indicates whether the object was created in the sandbox or not.
attr_accessor :sandbox

attr_accessor :paused

attr_accessor :version

class EnumAttributeValidator
attr_reader :datatype
attr_reader :allowable_values
Expand Down Expand Up @@ -87,6 +93,7 @@ def self.attribute_map
:'applicant_provides_data' => :'applicant_provides_data',
:'tags' => :'tags',
:'redirect_uri' => :'redirect_uri',
:'privacy_notices_read_consent_given' => :'privacy_notices_read_consent_given',
:'id' => :'id',
:'created_at' => :'created_at',
:'href' => :'href',
Expand All @@ -95,7 +102,9 @@ def self.attribute_map
:'form_uri' => :'form_uri',
:'results_uri' => :'results_uri',
:'report_ids' => :'report_ids',
:'sandbox' => :'sandbox'
:'sandbox' => :'sandbox',
:'paused' => :'paused',
:'version' => :'version'
}
end

Expand All @@ -112,6 +121,7 @@ def self.openapi_types
:'applicant_provides_data' => :'Boolean',
:'tags' => :'Array<String>',
:'redirect_uri' => :'String',
:'privacy_notices_read_consent_given' => :'Boolean',
:'id' => :'String',
:'created_at' => :'Time',
:'href' => :'String',
Expand All @@ -120,7 +130,9 @@ def self.openapi_types
:'form_uri' => :'String',
:'results_uri' => :'String',
:'report_ids' => :'Array<String>',
:'sandbox' => :'Boolean'
:'sandbox' => :'Boolean',
:'paused' => :'Boolean',
:'version' => :'String'
}
end

Expand Down Expand Up @@ -179,6 +191,10 @@ def initialize(attributes = {})
self.redirect_uri = attributes[:'redirect_uri']
end

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

if attributes.key?(:'id')
self.id = attributes[:'id']
else
Expand Down Expand Up @@ -218,6 +234,14 @@ def initialize(attributes = {})
if attributes.key?(:'sandbox')
self.sandbox = attributes[:'sandbox']
end

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

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

# Show invalid properties with the reasons. Usually used together with valid?
Expand Down Expand Up @@ -279,6 +303,7 @@ def ==(o)
applicant_provides_data == o.applicant_provides_data &&
tags == o.tags &&
redirect_uri == o.redirect_uri &&
privacy_notices_read_consent_given == o.privacy_notices_read_consent_given &&
id == o.id &&
created_at == o.created_at &&
href == o.href &&
Expand All @@ -287,7 +312,9 @@ def ==(o)
form_uri == o.form_uri &&
results_uri == o.results_uri &&
report_ids == o.report_ids &&
sandbox == o.sandbox
sandbox == o.sandbox &&
paused == o.paused &&
version == o.version
end

# @see the `==` method
Expand All @@ -299,7 +326,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[webhook_ids, applicant_id, applicant_provides_data, tags, redirect_uri, id, created_at, href, status, result, form_uri, results_uri, report_ids, sandbox].hash
[webhook_ids, applicant_id, applicant_provides_data, tags, redirect_uri, privacy_notices_read_consent_given, id, created_at, href, status, result, form_uri, results_uri, report_ids, sandbox, paused, version].hash
end

# Builds the object from hash
Expand Down
Loading

0 comments on commit 9504ccf

Please sign in to comment.