class Yoti::DocScan::Session::Create::SessionSpecificationBuilder

Public Class Methods

new() click to toggle source
# File lib/yoti/doc_scan/session/create/session_specification.rb, line 84
def initialize
  @requested_checks = []
  @requested_tasks = []
  @required_documents = []
end

Public Instance Methods

build() click to toggle source

@return [SessionSpecification]

# File lib/yoti/doc_scan/session/create/session_specification.rb, line 204
def build
  SessionSpecification.new(
    @client_session_token_ttl,
    @resources_ttl,
    @user_tracking_id,
    @notifications,
    @requested_checks,
    @requested_tasks,
    @sdk_config,
    @required_documents,
    @block_biometric_consent
  )
end
with_client_session_token_ttl(client_session_token_ttl) click to toggle source

Client-session-token time-to-live to apply to the created session

@param [Integer] client_session_token_ttl

@return [self]

# File lib/yoti/doc_scan/session/create/session_specification.rb, line 97
def with_client_session_token_ttl(client_session_token_ttl)
  @client_session_token_ttl = client_session_token_ttl
  self
end
with_notifications(notifications) click to toggle source

For configuring call-back messages

@param [NotificationConfig] notifications

@return [self]

# File lib/yoti/doc_scan/session/create/session_specification.rb, line 133
def with_notifications(notifications)
  @notifications = notifications
  self
end
with_requested_check(requested_check) click to toggle source

The check to be performed on each Document

@param [RequestedCheck] requested_check

@return [self]

# File lib/yoti/doc_scan/session/create/session_specification.rb, line 145
def with_requested_check(requested_check)
  Validation.assert_is_a(RequestedCheck, requested_check, 'requested_check')
  @requested_checks.push(requested_check)
  self
end
with_requested_task(requested_task) click to toggle source

The task to be performed on each Document

@param [RequestedTask] requested_task

@return [self]

# File lib/yoti/doc_scan/session/create/session_specification.rb, line 158
def with_requested_task(requested_task)
  Validation.assert_is_a(RequestedTask, requested_task, 'requested_task')
  @requested_tasks.push(requested_task)
  self
end
with_required_document(required_document) click to toggle source

Adds a RequiredDocument to the list documents required from the client

@param [RequiredDocument] required_document

@return [self]

# File lib/yoti/doc_scan/session/create/session_specification.rb, line 183
def with_required_document(required_document)
  Validation.assert_is_a(RequiredDocument, required_document, 'required_document')
  @required_documents.push(required_document)
  self
end
with_resources_ttl(resources_ttl) click to toggle source

Time-to-live used for all Resources created in the course of the session

@param [Integer] resources_ttl

@return [self]

# File lib/yoti/doc_scan/session/create/session_specification.rb, line 109
def with_resources_ttl(resources_ttl)
  @resources_ttl = resources_ttl
  self
end
with_sdk_config(sdk_config) click to toggle source

The SDK configuration set on the session specification

@param [SdkConfig] sdk_config

@return [self]

# File lib/yoti/doc_scan/session/create/session_specification.rb, line 171
def with_sdk_config(sdk_config)
  @sdk_config = sdk_config
  self
end
with_user_tracking_id(user_tracking_id) click to toggle source

User tracking id, for the Relying Business to track returning users

@param [String] user_tracking_id

@return [self]

# File lib/yoti/doc_scan/session/create/session_specification.rb, line 121
def with_user_tracking_id(user_tracking_id)
  @user_tracking_id = user_tracking_id
  self
end