Skip to content

Commit

Permalink
CAT-1068: added basic e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoPetteruti-Onfido committed May 14, 2024
1 parent dd248fe commit d3ad972
Show file tree
Hide file tree
Showing 78 changed files with 154 additions and 1,787 deletions.
6 changes: 3 additions & 3 deletions lib/onfido/api/default_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3200,7 +3200,7 @@ def list_workflow_runs_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: DefaultApi.list_workflow_runs ...'
end
allowable_values = ["desc", "asc", "unknown_default_open_api"]
allowable_values = ["desc", "asc"]
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
end
Expand Down Expand Up @@ -3898,11 +3898,11 @@ def upload_document_with_http_info(type, applicant_id, file, opts = {})
if @api_client.config.client_side_validation && file.nil?
fail ArgumentError, "Missing the required parameter 'file' when calling DefaultApi.upload_document"
end
allowable_values = ["jpg", "png", "pdf", "unknown_default_open_api"]
allowable_values = ["jpg", "png", "pdf"]
if @api_client.config.client_side_validation && opts[:'file_type'] && !allowable_values.include?(opts[:'file_type'])
fail ArgumentError, "invalid value for \"file_type\", must be one of #{allowable_values}"
end
allowable_values = ["front", "back", "unknown_default_open_api"]
allowable_values = ["front", "back"]
if @api_client.config.client_side_validation && opts[:'side'] && !allowable_values.include?(opts[:'side'])
fail ArgumentError, "invalid value for \"side\", must be one of #{allowable_values}"
end
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 = "OpenAPI-Generator/#{VERSION}/ruby"
@default_headers = {
'Content-Type' => 'application/json',
'User-Agent' => @user_agent
Expand Down
8 changes: 4 additions & 4 deletions lib/onfido/models/check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,17 @@ def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
return false if @applicant_id.nil?
return false if @id.nil?
status_validator = EnumAttributeValidator.new('String', ["in_progress", "awaiting_applicant", "complete", "withdrawn", "paused", "reopened", "unknown_default_open_api"])
status_validator = EnumAttributeValidator.new('String', ["in_progress", "awaiting_applicant", "complete", "withdrawn", "paused", "reopened"])
return false unless status_validator.valid?(@status)
result_validator = EnumAttributeValidator.new('String', ["clear", "consider", "unknown_default_open_api"])
result_validator = EnumAttributeValidator.new('String', ["clear", "consider"])
return false unless result_validator.valid?(@result)
true
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] status Object to be assigned
def status=(status)
validator = EnumAttributeValidator.new('String', ["in_progress", "awaiting_applicant", "complete", "withdrawn", "paused", "reopened", "unknown_default_open_api"])
validator = EnumAttributeValidator.new('String', ["in_progress", "awaiting_applicant", "complete", "withdrawn", "paused", "reopened"])
unless validator.valid?(status)
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
end
Expand All @@ -262,7 +262,7 @@ def status=(status)
# Custom attribute writer method checking allowed values (enum).
# @param [Object] result Object to be assigned
def result=(result)
validator = EnumAttributeValidator.new('String', ["clear", "consider", "unknown_default_open_api"])
validator = EnumAttributeValidator.new('String', ["clear", "consider"])
unless validator.valid?(result)
fail ArgumentError, "invalid value for \"result\", must be one of #{validator.allowable_values}."
end
Expand Down
8 changes: 4 additions & 4 deletions lib/onfido/models/check_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,17 @@ def list_invalid_properties
def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
return false if @id.nil?
status_validator = EnumAttributeValidator.new('String', ["in_progress", "awaiting_applicant", "complete", "withdrawn", "paused", "reopened", "unknown_default_open_api"])
status_validator = EnumAttributeValidator.new('String', ["in_progress", "awaiting_applicant", "complete", "withdrawn", "paused", "reopened"])
return false unless status_validator.valid?(@status)
result_validator = EnumAttributeValidator.new('String', ["clear", "consider", "unknown_default_open_api"])
result_validator = EnumAttributeValidator.new('String', ["clear", "consider"])
return false unless result_validator.valid?(@result)
true
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] status Object to be assigned
def status=(status)
validator = EnumAttributeValidator.new('String', ["in_progress", "awaiting_applicant", "complete", "withdrawn", "paused", "reopened", "unknown_default_open_api"])
validator = EnumAttributeValidator.new('String', ["in_progress", "awaiting_applicant", "complete", "withdrawn", "paused", "reopened"])
unless validator.valid?(status)
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
end
Expand All @@ -198,7 +198,7 @@ def status=(status)
# Custom attribute writer method checking allowed values (enum).
# @param [Object] result Object to be assigned
def result=(result)
validator = EnumAttributeValidator.new('String', ["clear", "consider", "unknown_default_open_api"])
validator = EnumAttributeValidator.new('String', ["clear", "consider"])
unless validator.valid?(result)
fail ArgumentError, "invalid value for \"result\", must be one of #{validator.allowable_values}."
end
Expand Down
4 changes: 2 additions & 2 deletions lib/onfido/models/consent_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ 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"])
name_validator = EnumAttributeValidator.new('String', ["privacy_notices_read", "ssn_verification", "phone_number_verification"])
return false unless name_validator.valid?(@name)
return false if @granted.nil?
true
Expand All @@ -127,7 +127,7 @@ def valid?
# 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"])
validator = EnumAttributeValidator.new('String', ["privacy_notices_read", "ssn_verification", "phone_number_verification"])
unless validator.valid?(name)
fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}."
end
Expand Down
3 changes: 1 addition & 2 deletions lib/onfido/models/country_codes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,9 @@ class CountryCodes
ZAF = "ZAF".freeze
ZMB = "ZMB".freeze
ZWE = "ZWE".freeze
UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze

def self.all_vars
@all_vars ||= [ABW, AFG, AGO, AIA, ALA, ALB, AND, ARE, ARG, ARM, ASM, ATA, ATF, ATG, AUS, AUT, AZE, BDI, BEL, BEN, BES, BFA, BGD, BGR, BHR, BHS, BIH, BLM, BLR, BLZ, BMU, BOL, BRA, BRB, BRN, BTN, BVT, BWA, CAF, CAN, CCK, CHE, CHL, CHN, CIV, CMR, COD, COG, COK, COL, COM, CPV, CRI, CUB, CUW, CXR, CYM, CYP, CZE, DEU, DJI, DMA, DNK, DOM, DZA, ECU, EGY, ERI, ESH, ESP, EST, ETH, FIN, FJI, FLK, FRA, FRO, FSM, GAB, GBR, GEO, GGY, GHA, GIB, GIN, GLP, GMB, GNB, GNQ, GRC, GRD, GRL, GTM, GUF, GUM, GUY, HKG, HMD, HND, HRV, HTI, HUN, IDN, IMN, IND, IOT, IRL, IRN, IRQ, ISL, ISR, ITA, JAM, JEY, JOR, JPN, KAZ, KEN, KGZ, KHM, KIR, KNA, KOR, KWT, LAO, LBN, LBR, LBY, LCA, LIE, LKA, LSO, LTU, LUX, LVA, MAC, MAF, MAR, MCO, MDA, MDG, MDV, MEX, MHL, MKD, MLI, MLT, MMR, MNE, MNG, MNP, MOZ, MRT, MSR, MTQ, MUS, MWI, MYS, MYT, NAM, NCL, NER, NFK, NGA, NIC, NIU, NLD, NOR, NPL, NRU, NZL, OMN, PAK, PAN, PCN, PER, PHL, PLW, PNG, POL, PRI, PRK, PRT, PRY, PSE, PYF, QAT, REU, RKS, ROU, RUS, RWA, SAU, SDN, SEN, SGP, SGS, SHN, SJM, SLB, SLE, SLV, SMR, SOM, SPM, SRB, SSD, STP, SUR, SVK, SVN, SWE, SWZ, SXM, SYC, SYR, TCA, TCD, TGO, THA, TJK, TKL, TKM, TLS, TON, TTO, TUN, TUR, TUV, TWN, TZA, UGA, UKR, UMI, URY, USA, UZB, VAT, VCT, VEN, VGB, VIR, VNM, VUT, WLF, WSM, YEM, ZAF, ZMB, ZWE, UNKNOWN_DEFAULT_OPEN_API].freeze
@all_vars ||= [ABW, AFG, AGO, AIA, ALA, ALB, AND, ARE, ARG, ARM, ASM, ATA, ATF, ATG, AUS, AUT, AZE, BDI, BEL, BEN, BES, BFA, BGD, BGR, BHR, BHS, BIH, BLM, BLR, BLZ, BMU, BOL, BRA, BRB, BRN, BTN, BVT, BWA, CAF, CAN, CCK, CHE, CHL, CHN, CIV, CMR, COD, COG, COK, COL, COM, CPV, CRI, CUB, CUW, CXR, CYM, CYP, CZE, DEU, DJI, DMA, DNK, DOM, DZA, ECU, EGY, ERI, ESH, ESP, EST, ETH, FIN, FJI, FLK, FRA, FRO, FSM, GAB, GBR, GEO, GGY, GHA, GIB, GIN, GLP, GMB, GNB, GNQ, GRC, GRD, GRL, GTM, GUF, GUM, GUY, HKG, HMD, HND, HRV, HTI, HUN, IDN, IMN, IND, IOT, IRL, IRN, IRQ, ISL, ISR, ITA, JAM, JEY, JOR, JPN, KAZ, KEN, KGZ, KHM, KIR, KNA, KOR, KWT, LAO, LBN, LBR, LBY, LCA, LIE, LKA, LSO, LTU, LUX, LVA, MAC, MAF, MAR, MCO, MDA, MDG, MDV, MEX, MHL, MKD, MLI, MLT, MMR, MNE, MNG, MNP, MOZ, MRT, MSR, MTQ, MUS, MWI, MYS, MYT, NAM, NCL, NER, NFK, NGA, NIC, NIU, NLD, NOR, NPL, NRU, NZL, OMN, PAK, PAN, PCN, PER, PHL, PLW, PNG, POL, PRI, PRK, PRT, PRY, PSE, PYF, QAT, REU, RKS, ROU, RUS, RWA, SAU, SDN, SEN, SGP, SGS, SHN, SJM, SLB, SLE, SLV, SMR, SOM, SPM, SRB, SSD, STP, SUR, SVK, SVN, SWE, SWZ, SXM, SYC, SYR, TCA, TCD, TGO, THA, TJK, TKL, TKM, TLS, TON, TTO, TUN, TUR, TUV, TWN, TZA, UGA, UKR, UMI, URY, USA, UZB, VAT, VCT, VEN, VGB, VIR, VNM, VUT, WLF, WSM, YEM, ZAF, ZMB, ZWE].freeze
end

# Builds the enum from string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,23 +251,23 @@ def list_invalid_properties
# @return true if the model is valid
def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
sdk_source_validator = EnumAttributeValidator.new('String', ["onfido-android-sdk", "onfido-ios-sdk", "onfido-web-sdk", "unknown_default_open_api"])
sdk_source_validator = EnumAttributeValidator.new('String', ["onfido-android-sdk", "onfido-ios-sdk", "onfido-web-sdk"])
return false unless sdk_source_validator.valid?(@sdk_source)
authentication_type_validator = EnumAttributeValidator.new('String', ["sdk_token", "mobile_token", "api_token", "unknown_default_open_api"])
authentication_type_validator = EnumAttributeValidator.new('String', ["sdk_token", "mobile_token", "api_token"])
return false unless authentication_type_validator.valid?(@authentication_type)
ip_reputation_validator = EnumAttributeValidator.new('String', ["NOT_ENOUGH_DATA", "HIGH_RISK", "LOW_RISK", "unknown_default_open_api"])
ip_reputation_validator = EnumAttributeValidator.new('String', ["NOT_ENOUGH_DATA", "HIGH_RISK", "LOW_RISK"])
return false unless ip_reputation_validator.valid?(@ip_reputation)
document_capture_validator = EnumAttributeValidator.new('String', ["live", "unknown_method", "unknown_default_open_api"])
document_capture_validator = EnumAttributeValidator.new('String', ["live", "unknown_method"])
return false unless document_capture_validator.valid?(@document_capture)
biometric_capture_validator = EnumAttributeValidator.new('String', ["live", "unknown_method", "unknown_default_open_api"])
biometric_capture_validator = EnumAttributeValidator.new('String', ["live", "unknown_method"])
return false unless biometric_capture_validator.valid?(@biometric_capture)
true
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] sdk_source Object to be assigned
def sdk_source=(sdk_source)
validator = EnumAttributeValidator.new('String', ["onfido-android-sdk", "onfido-ios-sdk", "onfido-web-sdk", "unknown_default_open_api"])
validator = EnumAttributeValidator.new('String', ["onfido-android-sdk", "onfido-ios-sdk", "onfido-web-sdk"])
unless validator.valid?(sdk_source)
fail ArgumentError, "invalid value for \"sdk_source\", must be one of #{validator.allowable_values}."
end
Expand All @@ -277,7 +277,7 @@ def sdk_source=(sdk_source)
# Custom attribute writer method checking allowed values (enum).
# @param [Object] authentication_type Object to be assigned
def authentication_type=(authentication_type)
validator = EnumAttributeValidator.new('String', ["sdk_token", "mobile_token", "api_token", "unknown_default_open_api"])
validator = EnumAttributeValidator.new('String', ["sdk_token", "mobile_token", "api_token"])
unless validator.valid?(authentication_type)
fail ArgumentError, "invalid value for \"authentication_type\", must be one of #{validator.allowable_values}."
end
Expand All @@ -287,7 +287,7 @@ def authentication_type=(authentication_type)
# Custom attribute writer method checking allowed values (enum).
# @param [Object] ip_reputation Object to be assigned
def ip_reputation=(ip_reputation)
validator = EnumAttributeValidator.new('String', ["NOT_ENOUGH_DATA", "HIGH_RISK", "LOW_RISK", "unknown_default_open_api"])
validator = EnumAttributeValidator.new('String', ["NOT_ENOUGH_DATA", "HIGH_RISK", "LOW_RISK"])
unless validator.valid?(ip_reputation)
fail ArgumentError, "invalid value for \"ip_reputation\", must be one of #{validator.allowable_values}."
end
Expand All @@ -297,7 +297,7 @@ def ip_reputation=(ip_reputation)
# Custom attribute writer method checking allowed values (enum).
# @param [Object] document_capture Object to be assigned
def document_capture=(document_capture)
validator = EnumAttributeValidator.new('String', ["live", "unknown_method", "unknown_default_open_api"])
validator = EnumAttributeValidator.new('String', ["live", "unknown_method"])
unless validator.valid?(document_capture)
fail ArgumentError, "invalid value for \"document_capture\", must be one of #{validator.allowable_values}."
end
Expand All @@ -307,7 +307,7 @@ def document_capture=(document_capture)
# Custom attribute writer method checking allowed values (enum).
# @param [Object] biometric_capture Object to be assigned
def biometric_capture=(biometric_capture)
validator = EnumAttributeValidator.new('String', ["live", "unknown_method", "unknown_default_open_api"])
validator = EnumAttributeValidator.new('String', ["live", "unknown_method"])
unless validator.valid?(biometric_capture)
fail ArgumentError, "invalid value for \"biometric_capture\", must be one of #{validator.allowable_values}."
end
Expand Down
8 changes: 4 additions & 4 deletions lib/onfido/models/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ def list_invalid_properties
# @return true if the model is valid
def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
file_type_validator = EnumAttributeValidator.new('String', ["jpg", "png", "pdf", "unknown_default_open_api"])
file_type_validator = EnumAttributeValidator.new('String', ["jpg", "png", "pdf"])
return false unless file_type_validator.valid?(@file_type)
side_validator = EnumAttributeValidator.new('String', ["front", "back", "unknown_default_open_api"])
side_validator = EnumAttributeValidator.new('String', ["front", "back"])
return false unless side_validator.valid?(@side)
return false if @id.nil?
true
Expand All @@ -212,7 +212,7 @@ def valid?
# Custom attribute writer method checking allowed values (enum).
# @param [Object] file_type Object to be assigned
def file_type=(file_type)
validator = EnumAttributeValidator.new('String', ["jpg", "png", "pdf", "unknown_default_open_api"])
validator = EnumAttributeValidator.new('String', ["jpg", "png", "pdf"])
unless validator.valid?(file_type)
fail ArgumentError, "invalid value for \"file_type\", must be one of #{validator.allowable_values}."
end
Expand All @@ -222,7 +222,7 @@ def file_type=(file_type)
# Custom attribute writer method checking allowed values (enum).
# @param [Object] side Object to be assigned
def side=(side)
validator = EnumAttributeValidator.new('String', ["front", "back", "unknown_default_open_api"])
validator = EnumAttributeValidator.new('String', ["front", "back"])
unless validator.valid?(side)
fail ArgumentError, "invalid value for \"side\", must be one of #{validator.allowable_values}."
end
Expand Down
8 changes: 4 additions & 4 deletions lib/onfido/models/document_shared.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,17 @@ def list_invalid_properties
# @return true if the model is valid
def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
file_type_validator = EnumAttributeValidator.new('String', ["jpg", "png", "pdf", "unknown_default_open_api"])
file_type_validator = EnumAttributeValidator.new('String', ["jpg", "png", "pdf"])
return false unless file_type_validator.valid?(@file_type)
side_validator = EnumAttributeValidator.new('String', ["front", "back", "unknown_default_open_api"])
side_validator = EnumAttributeValidator.new('String', ["front", "back"])
return false unless side_validator.valid?(@side)
true
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] file_type Object to be assigned
def file_type=(file_type)
validator = EnumAttributeValidator.new('String', ["jpg", "png", "pdf", "unknown_default_open_api"])
validator = EnumAttributeValidator.new('String', ["jpg", "png", "pdf"])
unless validator.valid?(file_type)
fail ArgumentError, "invalid value for \"file_type\", must be one of #{validator.allowable_values}."
end
Expand All @@ -153,7 +153,7 @@ def file_type=(file_type)
# Custom attribute writer method checking allowed values (enum).
# @param [Object] side Object to be assigned
def side=(side)
validator = EnumAttributeValidator.new('String', ["front", "back", "unknown_default_open_api"])
validator = EnumAttributeValidator.new('String', ["front", "back"])
unless validator.valid?(side)
fail ArgumentError, "invalid value for \"side\", must be one of #{validator.allowable_values}."
end
Expand Down
3 changes: 1 addition & 2 deletions lib/onfido/models/document_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ class DocumentTypes
PROFESSIONAL_QUALIFICATION_CARD = "professional_qualification_card".freeze
CONSULAR_ID = "consular_id".freeze
INTERNATIONAL_DRIVING_LICENCE = "international_driving_licence".freeze
UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze

def self.all_vars
@all_vars ||= [PASSPORT, DRIVING_LICENCE, NATIONAL_IDENTITY_CARD, RESIDENCE_PERMIT, PASSPORT_CARD, TAX_ID, VISA, VOTER_ID, RESIDENCE_STATUS_DOCUMENT, POSTAL_IDENTITY_CARD, SOCIAL_SECURITY_CARD, WORK_PERMIT, ASYLUM_REGISTRATION_CARD, NATIONAL_HEALTH_INSURANCE_CARD, MUNICIPALITY_IDENTITY_CARD, PRIVATE_OPERATORS_CARD, PROOF_OF_CITIZENSHIP, SERVICE_ID_CARD, IMMIGRATION_STATUS_DOCUMENT, INDIGENOUS_CARD, VEHICLE_REGISTRATION_CARD, CERTIFICATE_OF_NATURALISATION, PROFESSIONAL_QUALIFICATION_CARD, CONSULAR_ID, INTERNATIONAL_DRIVING_LICENCE, UNKNOWN_DEFAULT_OPEN_API].freeze
@all_vars ||= [PASSPORT, DRIVING_LICENCE, NATIONAL_IDENTITY_CARD, RESIDENCE_PERMIT, PASSPORT_CARD, TAX_ID, VISA, VOTER_ID, RESIDENCE_STATUS_DOCUMENT, POSTAL_IDENTITY_CARD, SOCIAL_SECURITY_CARD, WORK_PERMIT, ASYLUM_REGISTRATION_CARD, NATIONAL_HEALTH_INSURANCE_CARD, MUNICIPALITY_IDENTITY_CARD, PRIVATE_OPERATORS_CARD, PROOF_OF_CITIZENSHIP, SERVICE_ID_CARD, IMMIGRATION_STATUS_DOCUMENT, INDIGENOUS_CARD, VEHICLE_REGISTRATION_CARD, CERTIFICATE_OF_NATURALISATION, PROFESSIONAL_QUALIFICATION_CARD, CONSULAR_ID, INTERNATIONAL_DRIVING_LICENCE].freeze
end

# Builds the enum from string
Expand Down
Loading

0 comments on commit d3ad972

Please sign in to comment.