lib/passbase/models/identity_owner.rb in passbase-1.2.0 vs lib/passbase/models/identity_owner.rb in passbase-1.3.0

- old
+ new

@@ -4,15 +4,16 @@ ## Introduction <span class=\"subtext\"> Welcome to the Passbase Verifications API docs. This documentation will help you understand our models and the Verification API with its endpoints. Based on this you can build your own system (i.e. verification) and hook it up to Passbase. In case of feedback or questions you can reach us under this email address: [developer@passbase.com](mailto:developer@passbase.com). </span> A User submits a video selfie and valid identifying __Resources__ during a __Verification__ guided by the Passbase client-side integration. Once all the necessary __Resources__ are submitted, __Data points__ are extracted, digitized, and authenticated. These Data points then becomes part of the User's __Identity__. The User then consents to share __Resources__ and/or __Data points__ from their Identity with you. This information is passed to you and can be used to make decisions about a User (e.g. activate account). This table below explains our terminology further. | Term | Description | |-----------------------------------------|-------------| | [Identity](#tag/identity_model) | A set of Data points and Resources related to and owned by one single User. This data can be accessed by you through a Verification. | | Data points | Any data about a User extracted from a Resource (E.g. Passport Number, or Age). | | [Resource](#tag/resource_model) | A source document used to generate the Data points for a User (E.g. Passport). | | [User](#tag/user_model) | The owner of an email address associated with an Identity. | | Verification | A transaction through which a User consents to share Data points with you. If the Data points you request are not already available in the User's Identity, the Passbase client will ask the User to submit the necessary Resource required to extract them. | | Re-authentication (login) | A transaction through which a User can certify the ownership of Personal data previously shared through an Authentication. | # Authentication <span class=\"subtext\"> There are two forms of authentication for the API: <br/>&bull; API Key <br/>&bull; Bearer JWT Token </span> The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT +OpenAPI Generator version: 5.2.0-SNAPSHOT =end require 'date' +require 'time' module Passbase class IdentityOwner # Email of the user the identity belongs to attr_accessor :email @@ -30,10 +31,15 @@ :'first_name' => :'first_name', :'last_name' => :'last_name' } 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 { :'email' => :'String', :'first_name' => :'String', @@ -121,20 +127,20 @@ # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{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[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) end end self end @@ -143,12 +149,12 @@ # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer @@ -174,11 +180,13 @@ value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model - Passbase.const_get(type).build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = Passbase.const_get(type) + 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 @@ -200,11 +208,11 @@ 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 @@ -223,7 +231,9 @@ value.to_hash else value end end + end + end