Class: Idnow::Client
- Inherits:
-
Object
- Object
- Idnow::Client
- Includes:
- API::Authentication, API::AutomatedTesting, API::DocumentDefinitions, API::DownloadDocuments, API::RequestIdentifications, API::RetrieveIdentifications, API::UploadDocuments
- Defined in:
- lib/idnow/client.rb
Constant Summary collapse
- API_VERSION =
'v1'
Constants included from API::AutomatedTesting
Constants included from API::RetrieveIdentifications
API::RetrieveIdentifications::IDENTIFICATION_STATUSES
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
Instance Method Summary collapse
-
#initialize(env:, company_id:, api_key:, timeout: nil, sftp_options: {}) ⇒ Client
constructor
A new instance of Client.
Methods included from API::DownloadDocuments
Methods included from API::UploadDocuments
#upload_default_document, #upload_identification_document
Methods included from API::DocumentDefinitions
#create_document_definition, #list_cached_document_definitions, #list_document_definitions
Methods included from API::AutomatedTesting
#testing_request_video_chat, #testing_start
Methods included from API::RequestIdentifications
Methods included from API::RetrieveIdentifications
#download_identification, #get_identification, #get_identification_file, #list_identifications
Methods included from API::Authentication
Constructor Details
#initialize(env:, company_id:, api_key:, timeout: nil, sftp_options: {}) ⇒ Client
Returns a new instance of Client.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/idnow/client.rb', line 25 def initialize(env:, company_id:, api_key:, timeout: nil, sftp_options: {}) raise 'Please set env to :test or :live' unless Idnow::ENVIRONMENTS.keys.include?(env) raise 'Please set your company_id' if company_id.nil? raise 'Please set your api_key' if api_key.nil? @host = Idnow.endpoint(env, :host) @target_host = Idnow.endpoint(env, :target_host) @company_id = company_id @api_key = api_key @http_client = HttpClient.new(host: @host) [:timeout] = timeout if timeout @sftp_client = SftpClient.new(host: @host, username: @company_id, password: @api_key, options: ) end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
23 24 25 |
# File 'lib/idnow/client.rb', line 23 def host @host end |