Class: Velix::Modules::Onboarding

Inherits:
Object
  • Object
show all
Defined in:
lib/velix/modules/onboarding.rb

Overview

POST /v1/api/onboarding — scope onboarding:write

Defined Under Namespace

Classes: Result

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Onboarding

Returns a new instance of Onboarding.



10
11
12
# File 'lib/velix/modules/onboarding.rb', line 10

def initialize(client)
  @client = client
end

Instance Method Details

#create(name:, frames:, email: nil, phone: nil, document: nil, document_type: nil, external_id: nil, metadata: nil, role: nil, access_groups: nil) ⇒ Object

frames: array of base64 jpeg strings (no data URI prefix), min 1



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/velix/modules/onboarding.rb', line 15

def create(name:, frames:, email: nil, phone: nil, document: nil, document_type: nil,
           external_id: nil, metadata: nil, role: nil, access_groups: nil)
  body = { name: name, frames: frames }
  body[:email] = email if email
  body[:phone] = phone if phone
  body[:document] = document if document
  body[:document_type] = document_type if document_type
  body[:external_id] = external_id if external_id
  body[:metadata] =  if 
  body[:role] = role if role
  body[:access_groups] = access_groups if access_groups

  resp = @client.post("/v1/api/onboarding", body)

  Result.new(
    person_id: resp["person_id"],
    identity_id: resp["identity_id"],
    enrolled: resp["enrolled"],
    frames_processed: resp["frames_processed"],
    frames_results: resp["frames_results"],
    embedding_id: resp["embedding_id"],
    message: resp["message"]
  )
end