=begin #Verification API ## Introduction 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). 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 There are two forms of authentication for the API:
• API Key
• Bearer JWT Token
The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.0.0-SNAPSHOT =end require 'cgi' module Passbase class IdentityApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Get resource # Get a resource attached to an identity by providing the resource ID. # @param id [String] Identity id # @param resource_id [String] Resource id # @param [Hash] opts the optional parameters # @return [Resource] def get_identity_resource_by_id(id, resource_id, opts = {}) data, _status_code, _headers = get_identity_resource_by_id_with_http_info(id, resource_id, opts) data end # Get resource # Get a resource attached to an identity by providing the resource ID. # @param id [String] Identity id # @param resource_id [String] Resource id # @param [Hash] opts the optional parameters # @return [Array<(Resource, Integer, Hash)>] Resource data, response status code and response headers def get_identity_resource_by_id_with_http_info(id, resource_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: IdentityApi.get_identity_resource_by_id ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling IdentityApi.get_identity_resource_by_id" end # verify the required parameter 'resource_id' is set if @api_client.config.client_side_validation && resource_id.nil? fail ArgumentError, "Missing the required parameter 'resource_id' when calling IdentityApi.get_identity_resource_by_id" end # resource path local_var_path = '/identities/{id}/resource/{resource_id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'resource_id' + '}', CGI.escape(resource_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Resource' # auth_names auth_names = opts[:auth_names] || ['SecretApiKey'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: IdentityApi#get_identity_resource_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get identity # Retrieve an identity by providing the identity ID. # @param id [String] Unique ID of the identity to return # @param [Hash] opts the optional parameters # @return [Array] def get_identy_by_id(id, opts = {}) data, _status_code, _headers = get_identy_by_id_with_http_info(id, opts) data end # Get identity # Retrieve an identity by providing the identity ID. # @param id [String] Unique ID of the identity to return # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def get_identy_by_id_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: IdentityApi.get_identy_by_id ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling IdentityApi.get_identy_by_id" end # resource path local_var_path = '/identities/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Array' # auth_names auth_names = opts[:auth_names] || ['SecretApiKey'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: IdentityApi#get_identy_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List identities # List all the identities retrievable by the provided API Secret Key. # @param [Hash] opts the optional parameters # @option opts [Integer] :limit # @option opts [String] :cursor # @return [PaginatedIdentities] def list_identities(opts = {}) data, _status_code, _headers = list_identities_with_http_info(opts) data end # List identities # List all the identities retrievable by the provided API Secret Key. # @param [Hash] opts the optional parameters # @option opts [Integer] :limit # @option opts [String] :cursor # @return [Array<(PaginatedIdentities, Integer, Hash)>] PaginatedIdentities data, response status code and response headers def list_identities_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: IdentityApi.list_identities ...' end # resource path local_var_path = '/identities' # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PaginatedIdentities' # auth_names auth_names = opts[:auth_names] || ['SecretApiKey'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: IdentityApi#list_identities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List resources # List resources attached to an identity by providing the identity ID. # @param id [String] Identity id # @param [Hash] opts the optional parameters # @option opts [Integer] :limit # @option opts [String] :cursor # @return [PaginatedResources] def list_identity_resources(id, opts = {}) data, _status_code, _headers = list_identity_resources_with_http_info(id, opts) data end # List resources # List resources attached to an identity by providing the identity ID. # @param id [String] Identity id # @param [Hash] opts the optional parameters # @option opts [Integer] :limit # @option opts [String] :cursor # @return [Array<(PaginatedResources, Integer, Hash)>] PaginatedResources data, response status code and response headers def list_identity_resources_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: IdentityApi.list_identity_resources ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling IdentityApi.list_identity_resources" end # resource path local_var_path = '/identities/{id}/resources'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PaginatedResources' # auth_names auth_names = opts[:auth_names] || ['SecretApiKey'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: IdentityApi#list_identity_resources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end