From a4085d32e9fce389efeb56896d184cd086b11cd1 Mon Sep 17 00:00:00 2001 From: dvacca-onfido <134616519+dvacca-onfido@users.noreply.github.com> Date: Mon, 21 Oct 2024 07:41:07 +0000 Subject: [PATCH] Upgrade after onfido-openapi-spec change 9c6f606 --- .release.json | 6 +- lib/onfido.rb | 13 +- lib/onfido/api/default_api.rb | 4 +- lib/onfido/models/applicant_builder.rb | 7 +- .../{consent_item.rb => applicant_consent.rb} | 21 +- lib/onfido/models/applicant_consent_name.rb | 42 ++ lib/onfido/models/applicant_request.rb | 7 +- lib/onfido/models/applicant_updater.rb | 7 +- lib/onfido/models/check.rb | 50 ++- lib/onfido/models/check_builder.rb | 11 +- lib/onfido/models/check_response.rb | 41 +- lib/onfido/models/check_shared.rb | 17 +- lib/onfido/models/check_status.rb | 45 +++ lib/onfido/models/consents_builder.rb | 205 ---------- ...ntelligence_breakdown_properties_device.rb | 42 +- ...ce_intelligence_breakdown_properties_ip.rb | 38 +- lib/onfido/models/document.rb | 2 +- lib/onfido/models/document_shared.rb | 2 +- lib/onfido/models/document_types.rb | 7 +- lib/onfido/models/task_item.rb | 23 +- .../models/webhook_event_object_status.rb | 58 +++ lib/onfido/models/webhook_event_payload.rb | 5 +- .../models/webhook_event_payload_object.rb | 25 +- .../models/webhook_event_payload_resource.rb | 380 ++++++++++++++++++ .../models/webhook_event_resource_type.rb | 45 +++ lib/onfido/models/workflow_run.rb | 20 +- lib/onfido/models/workflow_run_builder.rb | 3 +- ...esponse_error.rb => workflow_run_error.rb} | 7 +- ...un_shared_link.rb => workflow_run_link.rb} | 11 +- lib/onfido/models/workflow_run_response.rb | 17 +- lib/onfido/models/workflow_run_shared.rb | 3 +- lib/onfido/models/workflow_run_status.rb | 47 +++ 32 files changed, 810 insertions(+), 401 deletions(-) rename lib/onfido/models/{consent_item.rb => applicant_consent.rb} (88%) create mode 100644 lib/onfido/models/applicant_consent_name.rb create mode 100644 lib/onfido/models/check_status.rb delete mode 100644 lib/onfido/models/consents_builder.rb create mode 100644 lib/onfido/models/webhook_event_object_status.rb create mode 100644 lib/onfido/models/webhook_event_payload_resource.rb create mode 100644 lib/onfido/models/webhook_event_resource_type.rb rename lib/onfido/models/{workflow_run_response_error.rb => workflow_run_error.rb} (95%) rename lib/onfido/models/{workflow_run_shared_link.rb => workflow_run_link.rb} (96%) create mode 100644 lib/onfido/models/workflow_run_status.rb diff --git a/.release.json b/.release.json index 0b7e16b..ff0612c 100644 --- a/.release.json +++ b/.release.json @@ -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": "9c6f606", + "long_sha": "9c6f6060cac558bd51e5b07271b5c9d437a8b03a", + "version": "" }, "release": "v3.4.0" } diff --git a/lib/onfido.rb b/lib/onfido.rb index 9881d7e..bd405cd 100644 --- a/lib/onfido.rb +++ b/lib/onfido.rb @@ -23,6 +23,8 @@ require 'onfido/models/addresses_list' require 'onfido/models/applicant' require 'onfido/models/applicant_builder' +require 'onfido/models/applicant_consent' +require 'onfido/models/applicant_consent_name' require 'onfido/models/applicant_create' require 'onfido/models/applicant_request' require 'onfido/models/applicant_response' @@ -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' @@ -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' @@ -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' diff --git a/lib/onfido/api/default_api.rb b/lib/onfido/api/default_api.rb index cbeddd3..0883fcf 100644 --- a/lib/onfido/api/default_api.rb +++ b/lib/onfido/api/default_api.rb @@ -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 @@ -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 diff --git a/lib/onfido/models/applicant_builder.rb b/lib/onfido/models/applicant_builder.rb index 8f69482..2e74656 100644 --- a/lib/onfido/models/applicant_builder.rb +++ b/lib/onfido/models/applicant_builder.rb @@ -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 @@ -65,7 +66,7 @@ def self.openapi_types :'dob' => :'Date', :'id_numbers' => :'Array', :'phone_number' => :'String', - :'consents' => :'ConsentsBuilder', + :'consents' => :'Array', :'address' => :'AddressBuilder', :'location' => :'LocationBuilder', :'first_name' => :'String', @@ -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') diff --git a/lib/onfido/models/consent_item.rb b/lib/onfido/models/applicant_consent.rb similarity index 88% rename from lib/onfido/models/consent_item.rb rename to lib/onfido/models/applicant_consent.rb index f10336d..7d84712 100644 --- a/lib/onfido/models/consent_item.rb +++ b/lib/onfido/models/applicant_consent.rb @@ -14,8 +14,7 @@ require 'time' module Onfido - # The applicant's consents - class ConsentItem + class ApplicantConsent attr_accessor :name attr_accessor :granted @@ -58,7 +57,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'name' => :'String', + :'name' => :'ApplicantConsentName', :'granted' => :'Boolean' } end @@ -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::ApplicantConsent` 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::ApplicantConsent`. 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 } @@ -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) diff --git a/lib/onfido/models/applicant_consent_name.rb b/lib/onfido/models/applicant_consent_name.rb new file mode 100644 index 0000000..f80b965 --- /dev/null +++ b/lib/onfido/models/applicant_consent_name.rb @@ -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 diff --git a/lib/onfido/models/applicant_request.rb b/lib/onfido/models/applicant_request.rb index 2ebd9f7..ffa193e 100644 --- a/lib/onfido/models/applicant_request.rb +++ b/lib/onfido/models/applicant_request.rb @@ -15,6 +15,7 @@ module Onfido class ApplicantRequest + # The applicant's consents attr_accessor :consents attr_accessor :address @@ -38,7 +39,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'consents' => :'ConsentsBuilder', + :'consents' => :'Array', :'address' => :'AddressBuilder', :'location' => :'LocationBuilder' } @@ -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') diff --git a/lib/onfido/models/applicant_updater.rb b/lib/onfido/models/applicant_updater.rb index d8b2b21..1418a32 100644 --- a/lib/onfido/models/applicant_updater.rb +++ b/lib/onfido/models/applicant_updater.rb @@ -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 @@ -65,7 +66,7 @@ def self.openapi_types :'dob' => :'Date', :'id_numbers' => :'Array', :'phone_number' => :'String', - :'consents' => :'ConsentsBuilder', + :'consents' => :'Array', :'address' => :'AddressBuilder', :'location' => :'LocationBuilder', :'first_name' => :'String', @@ -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') diff --git a/lib/onfido/models/check.rb b/lib/onfido/models/check.rb index 4abf48a..ef7d0cb 100644 --- a/lib/onfido/models/check.rb +++ b/lib/onfido/models/check.rb @@ -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 @@ -39,7 +41,6 @@ class Check # The uri of this resource. attr_accessor :href - # The current state of the check in the checking process. attr_accessor :status # The overall result of the check, based on the results of the constituent reports. @@ -57,6 +58,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 @@ -87,6 +92,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', @@ -95,7 +101,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 @@ -112,15 +120,18 @@ def self.openapi_types :'applicant_provides_data' => :'Boolean', :'tags' => :'Array', :'redirect_uri' => :'String', + :'privacy_notices_read_consent_given' => :'Boolean', :'id' => :'String', :'created_at' => :'Time', :'href' => :'String', - :'status' => :'String', + :'status' => :'CheckStatus', :'result' => :'String', :'form_uri' => :'String', :'results_uri' => :'String', :'report_ids' => :'Array', - :'sandbox' => :'Boolean' + :'sandbox' => :'Boolean', + :'paused' => :'Boolean', + :'version' => :'String' } end @@ -179,6 +190,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 @@ -218,6 +233,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? @@ -242,23 +265,11 @@ 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"]) - return false unless status_validator.valid?(@status) result_validator = EnumAttributeValidator.new('String', ["clear", "consider", "unknown_default_open_api"]) 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"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - # Custom attribute writer method checking allowed values (enum). # @param [Object] result Object to be assigned def result=(result) @@ -279,6 +290,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 && @@ -287,7 +299,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 @@ -299,7 +313,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 diff --git a/lib/onfido/models/check_builder.rb b/lib/onfido/models/check_builder.rb index 6950104..193d4d8 100644 --- a/lib/onfido/models/check_builder.rb +++ b/lib/onfido/models/check_builder.rb @@ -30,6 +30,8 @@ class CheckBuilder # 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 + # An array of report names (strings). attr_accessor :report_names @@ -58,6 +60,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', :'report_names' => :'report_names', :'document_ids' => :'document_ids', :'asynchronous' => :'asynchronous', @@ -81,6 +84,7 @@ def self.openapi_types :'applicant_provides_data' => :'Boolean', :'tags' => :'Array', :'redirect_uri' => :'String', + :'privacy_notices_read_consent_given' => :'Boolean', :'report_names' => :'Array', :'document_ids' => :'Array', :'asynchronous' => :'Boolean', @@ -148,6 +152,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?(:'report_names') if (value = attributes[:'report_names']).is_a?(Array) self.report_names = value @@ -222,6 +230,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 && report_names == o.report_names && document_ids == o.document_ids && asynchronous == o.asynchronous && @@ -240,7 +249,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, report_names, document_ids, asynchronous, suppress_form_emails, sub_result, consider, us_driving_licence].hash + [webhook_ids, applicant_id, applicant_provides_data, tags, redirect_uri, privacy_notices_read_consent_given, report_names, document_ids, asynchronous, suppress_form_emails, sub_result, consider, us_driving_licence].hash end # Builds the object from hash diff --git a/lib/onfido/models/check_response.rb b/lib/onfido/models/check_response.rb index 882b827..3b00023 100644 --- a/lib/onfido/models/check_response.rb +++ b/lib/onfido/models/check_response.rb @@ -24,7 +24,6 @@ class CheckResponse # The uri of this resource. attr_accessor :href - # The current state of the check in the checking process. attr_accessor :status # The overall result of the check, based on the results of the constituent reports. @@ -42,6 +41,10 @@ class CheckResponse # 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 @@ -75,7 +78,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 @@ -90,12 +95,14 @@ def self.openapi_types :'id' => :'String', :'created_at' => :'Time', :'href' => :'String', - :'status' => :'String', + :'status' => :'CheckStatus', :'result' => :'String', :'form_uri' => :'String', :'results_uri' => :'String', :'report_ids' => :'Array', - :'sandbox' => :'Boolean' + :'sandbox' => :'Boolean', + :'paused' => :'Boolean', + :'version' => :'String' } end @@ -159,6 +166,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? @@ -178,23 +193,11 @@ 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"]) - return false unless status_validator.valid?(@status) result_validator = EnumAttributeValidator.new('String', ["clear", "consider", "unknown_default_open_api"]) 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"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - # Custom attribute writer method checking allowed values (enum). # @param [Object] result Object to be assigned def result=(result) @@ -218,7 +221,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 @@ -230,7 +235,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, created_at, href, status, result, form_uri, results_uri, report_ids, sandbox].hash + [id, created_at, href, status, result, form_uri, results_uri, report_ids, sandbox, paused, version].hash end # Builds the object from hash diff --git a/lib/onfido/models/check_shared.rb b/lib/onfido/models/check_shared.rb index 310ca04..9e88750 100644 --- a/lib/onfido/models/check_shared.rb +++ b/lib/onfido/models/check_shared.rb @@ -30,6 +30,8 @@ class CheckShared # 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 + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -37,7 +39,8 @@ def self.attribute_map :'applicant_id' => :'applicant_id', :'applicant_provides_data' => :'applicant_provides_data', :'tags' => :'tags', - :'redirect_uri' => :'redirect_uri' + :'redirect_uri' => :'redirect_uri', + :'privacy_notices_read_consent_given' => :'privacy_notices_read_consent_given' } end @@ -53,7 +56,8 @@ def self.openapi_types :'applicant_id' => :'String', :'applicant_provides_data' => :'Boolean', :'tags' => :'Array', - :'redirect_uri' => :'String' + :'redirect_uri' => :'String', + :'privacy_notices_read_consent_given' => :'Boolean' } end @@ -103,6 +107,10 @@ def initialize(attributes = {}) if attributes.key?(:'redirect_uri') 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 end # Show invalid properties with the reasons. Usually used together with valid? @@ -134,7 +142,8 @@ def ==(o) applicant_id == o.applicant_id && applicant_provides_data == o.applicant_provides_data && tags == o.tags && - redirect_uri == o.redirect_uri + redirect_uri == o.redirect_uri && + privacy_notices_read_consent_given == o.privacy_notices_read_consent_given end # @see the `==` method @@ -146,7 +155,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].hash + [webhook_ids, applicant_id, applicant_provides_data, tags, redirect_uri, privacy_notices_read_consent_given].hash end # Builds the object from hash diff --git a/lib/onfido/models/check_status.rb b/lib/onfido/models/check_status.rb new file mode 100644 index 0000000..2781ded --- /dev/null +++ b/lib/onfido/models/check_status.rb @@ -0,0 +1,45 @@ +=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 CheckStatus + IN_PROGRESS = "in_progress".freeze + AWAITING_APPLICANT = "awaiting_applicant".freeze + COMPLETE = "complete".freeze + WITHDRAWN = "withdrawn".freeze + PAUSED = "paused".freeze + REOPENED = "reopened".freeze + UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze + + def self.all_vars + @all_vars ||= [IN_PROGRESS, AWAITING_APPLICANT, COMPLETE, WITHDRAWN, PAUSED, REOPENED, 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 CheckStatus.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #CheckStatus" + end + end +end diff --git a/lib/onfido/models/consents_builder.rb b/lib/onfido/models/consents_builder.rb deleted file mode 100644 index 570ec90..0000000 --- a/lib/onfido/models/consents_builder.rb +++ /dev/null @@ -1,205 +0,0 @@ -=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 ConsentsBuilder - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @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::ConsentsBuilder` 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::ConsentsBuilder`. 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 - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Onfido.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/onfido/models/device_intelligence_breakdown_properties_device.rb b/lib/onfido/models/device_intelligence_breakdown_properties_device.rb index 3e9be2d..30047ca 100644 --- a/lib/onfido/models/device_intelligence_breakdown_properties_device.rb +++ b/lib/onfido/models/device_intelligence_breakdown_properties_device.rb @@ -42,18 +42,6 @@ class DeviceIntelligenceBreakdownPropertiesDevice # Whether device is using stolen security tokens to send the network information. attr_accessor :fake_network_request - # The true operating system of the device. - attr_accessor :true_os - - # The likelihood of an operating system anomaly between the true OS and the OS sent by the device. - attr_accessor :os_anomaly - - # Whether the device is rooted. - attr_accessor :rooted - - # Whether the device is controlled via remote software. - attr_accessor :remote_software - # Whether there is highly suspicious traffic related to the IP address. The risk depends on the overall ratio of clear checks on a given IP. attr_accessor :ip_reputation @@ -103,10 +91,6 @@ def self.attribute_map :'emulator' => :'emulator', :'randomized_device' => :'randomized_device', :'fake_network_request' => :'fake_network_request', - :'true_os' => :'true_os', - :'os_anomaly' => :'os_anomaly', - :'rooted' => :'rooted', - :'remote_software' => :'remote_software', :'ip_reputation' => :'ip_reputation', :'device_fingerprint_reuse' => :'device_fingerprint_reuse', :'single_device_used' => :'single_device_used', @@ -132,10 +116,6 @@ def self.openapi_types :'emulator' => :'Boolean', :'randomized_device' => :'Boolean', :'fake_network_request' => :'Boolean', - :'true_os' => :'String', - :'os_anomaly' => :'String', - :'rooted' => :'Boolean', - :'remote_software' => :'Boolean', :'ip_reputation' => :'String', :'device_fingerprint_reuse' => :'Integer', :'single_device_used' => :'Boolean', @@ -202,22 +182,6 @@ def initialize(attributes = {}) self.fake_network_request = attributes[:'fake_network_request'] end - if attributes.key?(:'true_os') - self.true_os = attributes[:'true_os'] - end - - if attributes.key?(:'os_anomaly') - self.os_anomaly = attributes[:'os_anomaly'] - end - - if attributes.key?(:'rooted') - self.rooted = attributes[:'rooted'] - end - - if attributes.key?(:'remote_software') - self.remote_software = attributes[:'remote_software'] - end - if attributes.key?(:'ip_reputation') self.ip_reputation = attributes[:'ip_reputation'] end @@ -328,10 +292,6 @@ def ==(o) emulator == o.emulator && randomized_device == o.randomized_device && fake_network_request == o.fake_network_request && - true_os == o.true_os && - os_anomaly == o.os_anomaly && - rooted == o.rooted && - remote_software == o.remote_software && ip_reputation == o.ip_reputation && device_fingerprint_reuse == o.device_fingerprint_reuse && single_device_used == o.single_device_used && @@ -348,7 +308,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [sdk_version, sdk_source, authentication_type, raw_model, os, browser, emulator, randomized_device, fake_network_request, true_os, os_anomaly, rooted, remote_software, ip_reputation, device_fingerprint_reuse, single_device_used, document_capture, biometric_capture].hash + [sdk_version, sdk_source, authentication_type, raw_model, os, browser, emulator, randomized_device, fake_network_request, ip_reputation, device_fingerprint_reuse, single_device_used, document_capture, biometric_capture].hash end # Builds the object from hash diff --git a/lib/onfido/models/device_intelligence_breakdown_properties_ip.rb b/lib/onfido/models/device_intelligence_breakdown_properties_ip.rb index 966ee9a..bca74b5 100644 --- a/lib/onfido/models/device_intelligence_breakdown_properties_ip.rb +++ b/lib/onfido/models/device_intelligence_breakdown_properties_ip.rb @@ -18,22 +18,10 @@ class DeviceIntelligenceBreakdownPropertiesIp # The IP address that uploaded the media. attr_accessor :address - # The likelihood of the network connection being a VPN. - attr_accessor :vpn_detection - - # The likelihood of the network connection being a Proxy. - attr_accessor :proxy_detection - - # The type of organization that owns this IP address. - attr_accessor :type - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'address' => :'address', - :'vpn_detection' => :'vpn_detection', - :'proxy_detection' => :'proxy_detection', - :'type' => :'type' + :'address' => :'address' } end @@ -45,10 +33,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'address' => :'String', - :'vpn_detection' => :'String', - :'proxy_detection' => :'String', - :'type' => :'String' + :'address' => :'String' } end @@ -76,18 +61,6 @@ def initialize(attributes = {}) if attributes.key?(:'address') self.address = attributes[:'address'] end - - if attributes.key?(:'vpn_detection') - self.vpn_detection = attributes[:'vpn_detection'] - end - - if attributes.key?(:'proxy_detection') - self.proxy_detection = attributes[:'proxy_detection'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -110,10 +83,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - address == o.address && - vpn_detection == o.vpn_detection && - proxy_detection == o.proxy_detection && - type == o.type + address == o.address end # @see the `==` method @@ -125,7 +95,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [address, vpn_detection, proxy_detection, type].hash + [address].hash end # Builds the object from hash diff --git a/lib/onfido/models/document.rb b/lib/onfido/models/document.rb index c91f0f1..009bd2c 100644 --- a/lib/onfido/models/document.rb +++ b/lib/onfido/models/document.rb @@ -96,7 +96,7 @@ def self.acceptable_attributes def self.openapi_types { :'file_type' => :'String', - :'type' => :'String', + :'type' => :'DocumentTypes', :'side' => :'String', :'issuing_country' => :'CountryCodes', :'applicant_id' => :'String', diff --git a/lib/onfido/models/document_shared.rb b/lib/onfido/models/document_shared.rb index ca630f0..2d33bb3 100644 --- a/lib/onfido/models/document_shared.rb +++ b/lib/onfido/models/document_shared.rb @@ -72,7 +72,7 @@ def self.acceptable_attributes def self.openapi_types { :'file_type' => :'String', - :'type' => :'String', + :'type' => :'DocumentTypes', :'side' => :'String', :'issuing_country' => :'CountryCodes', :'applicant_id' => :'String' diff --git a/lib/onfido/models/document_types.rb b/lib/onfido/models/document_types.rb index fa5f82d..4af57e8 100644 --- a/lib/onfido/models/document_types.rb +++ b/lib/onfido/models/document_types.rb @@ -40,10 +40,15 @@ class DocumentTypes PROFESSIONAL_QUALIFICATION_CARD = "professional_qualification_card".freeze CONSULAR_ID = "consular_id".freeze INTERNATIONAL_DRIVING_LICENCE = "international_driving_licence".freeze + HOME_OFFICE_LETTER = "home_office_letter".freeze + BIRTH_CERTIFICATE = "birth_certificate".freeze + VEHICLE_REGISTRATION_CERTIFICATE = "vehicle_registration_certificate".freeze + FORM_FOR_AFFIXING_THE_VISA = "form_for_affixing_the_visa".freeze + IDENTIFICATION_NUMBER_DOCUMENT = "identification_number_document".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, HOME_OFFICE_LETTER, BIRTH_CERTIFICATE, VEHICLE_REGISTRATION_CERTIFICATE, FORM_FOR_AFFIXING_THE_VISA, IDENTIFICATION_NUMBER_DOCUMENT, UNKNOWN_DEFAULT_OPEN_API].freeze end # Builds the enum from string diff --git a/lib/onfido/models/task_item.rb b/lib/onfido/models/task_item.rb index d1e3ab5..8f1a2a3 100644 --- a/lib/onfido/models/task_item.rb +++ b/lib/onfido/models/task_item.rb @@ -18,9 +18,15 @@ class TaskItem # The identifier for the Task. attr_accessor :id + # The workflow run id the task belongs to. + attr_accessor :workflow_run_id + # The identifier for the Task Definition. attr_accessor :task_def_id + # The task definition version. + attr_accessor :task_def_version + # The date and time when the Task was created. attr_accessor :created_at @@ -31,7 +37,9 @@ class TaskItem def self.attribute_map { :'id' => :'id', + :'workflow_run_id' => :'workflow_run_id', :'task_def_id' => :'task_def_id', + :'task_def_version' => :'task_def_version', :'created_at' => :'created_at', :'updated_at' => :'updated_at' } @@ -46,7 +54,9 @@ def self.acceptable_attributes def self.openapi_types { :'id' => :'String', + :'workflow_run_id' => :'String', :'task_def_id' => :'String', + :'task_def_version' => :'String', :'created_at' => :'Time', :'updated_at' => :'Time' } @@ -55,6 +65,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'task_def_version', ]) end @@ -77,10 +88,18 @@ def initialize(attributes = {}) self.id = attributes[:'id'] end + if attributes.key?(:'workflow_run_id') + self.workflow_run_id = attributes[:'workflow_run_id'] + end + if attributes.key?(:'task_def_id') self.task_def_id = attributes[:'task_def_id'] end + if attributes.key?(:'task_def_version') + self.task_def_version = attributes[:'task_def_version'] + end + if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end @@ -153,7 +172,9 @@ def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && + workflow_run_id == o.workflow_run_id && task_def_id == o.task_def_id && + task_def_version == o.task_def_version && created_at == o.created_at && updated_at == o.updated_at end @@ -167,7 +188,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, task_def_id, created_at, updated_at].hash + [id, workflow_run_id, task_def_id, task_def_version, created_at, updated_at].hash end # Builds the object from hash diff --git a/lib/onfido/models/webhook_event_object_status.rb b/lib/onfido/models/webhook_event_object_status.rb new file mode 100644 index 0000000..4e6cbd3 --- /dev/null +++ b/lib/onfido/models/webhook_event_object_status.rb @@ -0,0 +1,58 @@ +=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 WebhookEventObjectStatus + PROCESSING = "processing".freeze + AWAITING_INPUT = "awaiting_input".freeze + AWAITING_CLIENT_INPUT = "awaiting_client_input".freeze + APPROVED = "approved".freeze + DECLINED = "declined".freeze + REVIEW = "review".freeze + ABANDONED = "abandoned".freeze + ERROR = "error".freeze + STARTED = "started".freeze + CANCELLED = "cancelled".freeze + COMPLETED = "completed".freeze + AWAITING_DATA = "awaiting_data".freeze + AWAITING_APPROVAL = "awaiting_approval".freeze + COMPLETE = "complete".freeze + WITHDRAWN = "withdrawn".freeze + IN_PROGRESS = "in_progress".freeze + AWAITING_APPLICANT = "awaiting_applicant".freeze + PAUSED = "paused".freeze + REOPENED = "reopened".freeze + UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze + + def self.all_vars + @all_vars ||= [PROCESSING, AWAITING_INPUT, AWAITING_CLIENT_INPUT, APPROVED, DECLINED, REVIEW, ABANDONED, ERROR, STARTED, CANCELLED, COMPLETED, AWAITING_DATA, AWAITING_APPROVAL, COMPLETE, WITHDRAWN, IN_PROGRESS, AWAITING_APPLICANT, PAUSED, REOPENED, 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 WebhookEventObjectStatus.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #WebhookEventObjectStatus" + end + end +end diff --git a/lib/onfido/models/webhook_event_payload.rb b/lib/onfido/models/webhook_event_payload.rb index b01d697..3220928 100644 --- a/lib/onfido/models/webhook_event_payload.rb +++ b/lib/onfido/models/webhook_event_payload.rb @@ -23,7 +23,6 @@ class WebhookEventPayload attr_accessor :object - # The resource affected by this event. attr_accessor :resource class EnumAttributeValidator @@ -66,10 +65,10 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'resource_type' => :'String', + :'resource_type' => :'WebhookEventResourceType', :'action' => :'WebhookEventType', :'object' => :'WebhookEventPayloadObject', - :'resource' => :'Object' + :'resource' => :'WebhookEventPayloadResource' } end diff --git a/lib/onfido/models/webhook_event_payload_object.rb b/lib/onfido/models/webhook_event_payload_object.rb index d8650aa..35f2f29 100644 --- a/lib/onfido/models/webhook_event_payload_object.rb +++ b/lib/onfido/models/webhook_event_payload_object.rb @@ -19,7 +19,6 @@ class WebhookEventPayloadObject # The unique identifier of the resource. attr_accessor :id - # The current state of the object, if available. attr_accessor :status # The date and time when the operation was started, if available. @@ -31,6 +30,28 @@ class WebhookEventPayloadObject # The uri of the resource. attr_accessor :href + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -51,7 +72,7 @@ def self.acceptable_attributes def self.openapi_types { :'id' => :'String', - :'status' => :'String', + :'status' => :'WebhookEventObjectStatus', :'started_at_iso8601' => :'Time', :'completed_at_iso8601' => :'Time', :'href' => :'String' diff --git a/lib/onfido/models/webhook_event_payload_resource.rb b/lib/onfido/models/webhook_event_payload_resource.rb new file mode 100644 index 0000000..548a990 --- /dev/null +++ b/lib/onfido/models/webhook_event_payload_resource.rb @@ -0,0 +1,380 @@ +=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 + # The resource affected by this event. + class WebhookEventPayloadResource + # The identifier of the resource. + attr_accessor :id + + # The unique identifier for the Applicant. + attr_accessor :applicant_id + + # The date and time when the resource was created. + attr_accessor :created_at + + # The date and time when the resource was last updated. + attr_accessor :updated_at + + # The URL for viewing the resource on Onfido Dashboard. + attr_accessor :dashboard_url + + # The unique identifier for the Workflow. + attr_accessor :workflow_id + + attr_accessor :workflow_run_id + + # The identifier for the Workflow version. + attr_accessor :workflow_version_id + + # The identifier for the Task Definition. + attr_accessor :task_def_id + + # The task definition version. + attr_accessor :task_def_version + + # Input object with the fields used by the Task execution. + attr_accessor :input + + # Output object with the fields produced by the Task execution. + attr_accessor :output + + # The reasons the Workflow Run outcome was reached. Configurable when creating the Workflow Version. + attr_accessor :reasons + + # Object for the configuration of the Workflow Run link. + attr_accessor :link + + # Error object that details why a Workflow Run is in Error status. + attr_accessor :error + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'applicant_id' => :'applicant_id', + :'created_at' => :'created_at', + :'updated_at' => :'updated_at', + :'dashboard_url' => :'dashboard_url', + :'workflow_id' => :'workflow_id', + :'workflow_run_id' => :'workflow_run_id', + :'workflow_version_id' => :'workflow_version_id', + :'task_def_id' => :'task_def_id', + :'task_def_version' => :'task_def_version', + :'input' => :'input', + :'output' => :'output', + :'reasons' => :'reasons', + :'link' => :'link', + :'error' => :'error' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'applicant_id' => :'String', + :'created_at' => :'Time', + :'updated_at' => :'Time', + :'dashboard_url' => :'String', + :'workflow_id' => :'String', + :'workflow_run_id' => :'String', + :'workflow_version_id' => :'Integer', + :'task_def_id' => :'String', + :'task_def_version' => :'String', + :'input' => :'Object', + :'output' => :'Object', + :'reasons' => :'Array', + :'link' => :'WorkflowRunLink', + :'error' => :'WorkflowRunError' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'task_def_version', + :'output', + ]) + end + + # Initializes the object + # @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::WebhookEventPayloadResource` 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::WebhookEventPayloadResource`. 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 + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'applicant_id') + self.applicant_id = attributes[:'applicant_id'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'dashboard_url') + self.dashboard_url = attributes[:'dashboard_url'] + end + + if attributes.key?(:'workflow_id') + self.workflow_id = attributes[:'workflow_id'] + end + + if attributes.key?(:'workflow_run_id') + self.workflow_run_id = attributes[:'workflow_run_id'] + end + + if attributes.key?(:'workflow_version_id') + self.workflow_version_id = attributes[:'workflow_version_id'] + end + + if attributes.key?(:'task_def_id') + self.task_def_id = attributes[:'task_def_id'] + end + + if attributes.key?(:'task_def_version') + self.task_def_version = attributes[:'task_def_version'] + end + + if attributes.key?(:'input') + self.input = attributes[:'input'] + end + + if attributes.key?(:'output') + self.output = attributes[:'output'] + end + + if attributes.key?(:'reasons') + if (value = attributes[:'reasons']).is_a?(Array) + self.reasons = value + end + end + + if attributes.key?(:'link') + self.link = attributes[:'link'] + end + + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + 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}.") + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + 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] task_def_id Value to be assigned + def task_def_id=(task_def_id) + if task_def_id.nil? + fail ArgumentError, 'task_def_id cannot be nil' + end + + pattern = Regexp.new(/^[0-9a-z_-]+$/) + if task_def_id !~ pattern + fail ArgumentError, "invalid value for \"task_def_id\", must conform to the pattern #{pattern}." + end + + @task_def_id = task_def_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + applicant_id == o.applicant_id && + created_at == o.created_at && + updated_at == o.updated_at && + dashboard_url == o.dashboard_url && + workflow_id == o.workflow_id && + workflow_run_id == o.workflow_run_id && + workflow_version_id == o.workflow_version_id && + task_def_id == o.task_def_id && + task_def_version == o.task_def_version && + input == o.input && + output == o.output && + reasons == o.reasons && + link == o.link && + error == o.error + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # 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 + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Onfido.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onfido/models/webhook_event_resource_type.rb b/lib/onfido/models/webhook_event_resource_type.rb new file mode 100644 index 0000000..d3d1e02 --- /dev/null +++ b/lib/onfido/models/webhook_event_resource_type.rb @@ -0,0 +1,45 @@ +=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 WebhookEventResourceType + CHECK = "check".freeze + REPORT = "report".freeze + AUDIT_LOG = "audit_log".freeze + WORKFLOW_RUN = "workflow_run".freeze + WORKFLOW_TASK = "workflow_task".freeze + WATCHLIST_MONITOR = "watchlist_monitor".freeze + UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze + + def self.all_vars + @all_vars ||= [CHECK, REPORT, AUDIT_LOG, WORKFLOW_RUN, WORKFLOW_TASK, WATCHLIST_MONITOR, 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 WebhookEventResourceType.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #WebhookEventResourceType" + end + end +end diff --git a/lib/onfido/models/workflow_run.rb b/lib/onfido/models/workflow_run.rb index 871b850..3adc4c1 100644 --- a/lib/onfido/models/workflow_run.rb +++ b/lib/onfido/models/workflow_run.rb @@ -27,6 +27,7 @@ class WorkflowRun # Customer-provided user identifier. attr_accessor :customer_user_id + # Object for the configuration of the Workflow Run link. attr_accessor :link # The date and time when the Workflow Run was created. @@ -53,6 +54,7 @@ class WorkflowRun # The reasons the Workflow Run outcome was reached. Configurable when creating the Workflow version. attr_accessor :reasons + # Error object. Only set when the Workflow Run status is 'error'. attr_accessor :error # Client token to use when loading this workflow run in the Onfido SDK. @@ -113,16 +115,16 @@ def self.openapi_types :'workflow_id' => :'String', :'tags' => :'Array', :'customer_user_id' => :'String', - :'link' => :'WorkflowRunSharedLink', + :'link' => :'WorkflowRunLink', :'created_at' => :'Time', :'updated_at' => :'Time', :'id' => :'String', :'workflow_version_id' => :'Integer', :'dashboard_url' => :'String', - :'status' => :'String', + :'status' => :'WorkflowRunStatus', :'output' => :'Object', :'reasons' => :'Array', - :'error' => :'WorkflowRunResponseError', + :'error' => :'WorkflowRunError', :'sdk_token' => :'String' } end @@ -266,8 +268,6 @@ def valid? return false if !@tags.nil? && @tags.length > 30 return false if !@customer_user_id.nil? && @customer_user_id.to_s.length > 256 return false if @id.nil? - status_validator = EnumAttributeValidator.new('String', ["awaiting_input", "processing", "abandoned", "error", "approved", "review", "declined", "unknown_default_open_api"]) - return false unless status_validator.valid?(@status) true end @@ -295,16 +295,6 @@ def customer_user_id=(customer_user_id) @customer_user_id = customer_user_id end - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["awaiting_input", "processing", "abandoned", "error", "approved", "review", "declined", "unknown_default_open_api"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/lib/onfido/models/workflow_run_builder.rb b/lib/onfido/models/workflow_run_builder.rb index 568ca5d..6302e2e 100644 --- a/lib/onfido/models/workflow_run_builder.rb +++ b/lib/onfido/models/workflow_run_builder.rb @@ -27,6 +27,7 @@ class WorkflowRunBuilder # Customer-provided user identifier. attr_accessor :customer_user_id + # Object for the configuration of the Workflow Run link. attr_accessor :link # The date and time when the Workflow Run was created. @@ -64,7 +65,7 @@ def self.openapi_types :'workflow_id' => :'String', :'tags' => :'Array', :'customer_user_id' => :'String', - :'link' => :'WorkflowRunSharedLink', + :'link' => :'WorkflowRunLink', :'created_at' => :'Time', :'updated_at' => :'Time', :'custom_data' => :'Hash' diff --git a/lib/onfido/models/workflow_run_response_error.rb b/lib/onfido/models/workflow_run_error.rb similarity index 95% rename from lib/onfido/models/workflow_run_response_error.rb rename to lib/onfido/models/workflow_run_error.rb index c7ec0d4..d863dd8 100644 --- a/lib/onfido/models/workflow_run_response_error.rb +++ b/lib/onfido/models/workflow_run_error.rb @@ -14,8 +14,7 @@ require 'time' module Onfido - # Error object. Only set when the Workflow Run status is 'error'. - class WorkflowRunResponseError + class WorkflowRunError # The type of error. attr_accessor :type @@ -53,13 +52,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::WorkflowRunResponseError` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::WorkflowRunError` 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::WorkflowRunResponseError`. 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::WorkflowRunError`. 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 } diff --git a/lib/onfido/models/workflow_run_shared_link.rb b/lib/onfido/models/workflow_run_link.rb similarity index 96% rename from lib/onfido/models/workflow_run_shared_link.rb rename to lib/onfido/models/workflow_run_link.rb index 01b5bb8..8b97ee3 100644 --- a/lib/onfido/models/workflow_run_shared_link.rb +++ b/lib/onfido/models/workflow_run_link.rb @@ -14,8 +14,7 @@ require 'time' module Onfido - # Object for the configuration of the Workflow Run link. - class WorkflowRunSharedLink + class WorkflowRunLink # Link to access the Workflow Run without the need to integrate with Onfido's SDKs. attr_accessor :url @@ -83,6 +82,10 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'completed_redirect_url', + :'expired_redirect_url', + :'expires_at', + :'language' ]) end @@ -90,13 +93,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::WorkflowRunSharedLink` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::WorkflowRunLink` 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::WorkflowRunSharedLink`. 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::WorkflowRunLink`. 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 } diff --git a/lib/onfido/models/workflow_run_response.rb b/lib/onfido/models/workflow_run_response.rb index ab41bf3..cc36348 100644 --- a/lib/onfido/models/workflow_run_response.rb +++ b/lib/onfido/models/workflow_run_response.rb @@ -33,6 +33,7 @@ class WorkflowRunResponse # The reasons the Workflow Run outcome was reached. Configurable when creating the Workflow version. attr_accessor :reasons + # Error object. Only set when the Workflow Run status is 'error'. attr_accessor :error # Client token to use when loading this workflow run in the Onfido SDK. @@ -85,10 +86,10 @@ def self.openapi_types :'id' => :'String', :'workflow_version_id' => :'Integer', :'dashboard_url' => :'String', - :'status' => :'String', + :'status' => :'WorkflowRunStatus', :'output' => :'Object', :'reasons' => :'Array', - :'error' => :'WorkflowRunResponseError', + :'error' => :'WorkflowRunError', :'sdk_token' => :'String' } end @@ -169,21 +170,9 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? - status_validator = EnumAttributeValidator.new('String', ["awaiting_input", "processing", "abandoned", "error", "approved", "review", "declined", "unknown_default_open_api"]) - return false unless status_validator.valid?(@status) true end - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["awaiting_input", "processing", "abandoned", "error", "approved", "review", "declined", "unknown_default_open_api"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/lib/onfido/models/workflow_run_shared.rb b/lib/onfido/models/workflow_run_shared.rb index dbd9fe7..46f5061 100644 --- a/lib/onfido/models/workflow_run_shared.rb +++ b/lib/onfido/models/workflow_run_shared.rb @@ -27,6 +27,7 @@ class WorkflowRunShared # Customer-provided user identifier. attr_accessor :customer_user_id + # Object for the configuration of the Workflow Run link. attr_accessor :link # The date and time when the Workflow Run was created. @@ -60,7 +61,7 @@ def self.openapi_types :'workflow_id' => :'String', :'tags' => :'Array', :'customer_user_id' => :'String', - :'link' => :'WorkflowRunSharedLink', + :'link' => :'WorkflowRunLink', :'created_at' => :'Time', :'updated_at' => :'Time' } diff --git a/lib/onfido/models/workflow_run_status.rb b/lib/onfido/models/workflow_run_status.rb new file mode 100644 index 0000000..b0d6c2b --- /dev/null +++ b/lib/onfido/models/workflow_run_status.rb @@ -0,0 +1,47 @@ +=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 WorkflowRunStatus + PROCESSING = "processing".freeze + AWAITING_INPUT = "awaiting_input".freeze + AWAITING_CLIENT_INPUT = "awaiting_client_input".freeze + APPROVED = "approved".freeze + DECLINED = "declined".freeze + REVIEW = "review".freeze + ABANDONED = "abandoned".freeze + ERROR = "error".freeze + UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze + + def self.all_vars + @all_vars ||= [PROCESSING, AWAITING_INPUT, AWAITING_CLIENT_INPUT, APPROVED, DECLINED, REVIEW, ABANDONED, ERROR, 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 WorkflowRunStatus.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #WorkflowRunStatus" + end + end +end