Class: Yoti::DocScan::Session::Create::SessionSpecificationBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/yoti/doc_scan/session/create/session_specification.rb

Instance Method Summary collapse

Constructor Details

#initializeSessionSpecificationBuilder

Returns a new instance of SessionSpecificationBuilder.



79
80
81
82
83
# File 'lib/yoti/doc_scan/session/create/session_specification.rb', line 79

def initialize
  @requested_checks = []
  @requested_tasks = []
  @required_documents = []
end

Instance Method Details

#buildSessionSpecification



187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/yoti/doc_scan/session/create/session_specification.rb', line 187

def build
  SessionSpecification.new(
    @client_session_token_ttl,
    @resources_ttl,
    @user_tracking_id,
    @notifications,
    @requested_checks,
    @requested_tasks,
    @sdk_config,
    @required_documents
  )
end

#with_client_session_token_ttl(client_session_token_ttl) ⇒ self

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

Parameters:

  • client_session_token_ttl (Integer)

Returns:

  • (self)


92
93
94
95
# File 'lib/yoti/doc_scan/session/create/session_specification.rb', line 92

def with_client_session_token_ttl(client_session_token_ttl)
  @client_session_token_ttl = client_session_token_ttl
  self
end

#with_notifications(notifications) ⇒ self

For configuring call-back messages

Parameters:

Returns:

  • (self)


128
129
130
131
# File 'lib/yoti/doc_scan/session/create/session_specification.rb', line 128

def with_notifications(notifications)
  @notifications = notifications
  self
end

#with_requested_check(requested_check) ⇒ self

The check to be performed on each Document

Parameters:

Returns:

  • (self)


140
141
142
143
144
# File 'lib/yoti/doc_scan/session/create/session_specification.rb', line 140

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) ⇒ self

The task to be performed on each Document

Parameters:

Returns:

  • (self)


153
154
155
156
157
# File 'lib/yoti/doc_scan/session/create/session_specification.rb', line 153

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) ⇒ self

Adds a RequiredDocument to the list documents required from the client

Parameters:

Returns:

  • (self)


178
179
180
181
182
# File 'lib/yoti/doc_scan/session/create/session_specification.rb', line 178

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) ⇒ self

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

Parameters:

  • resources_ttl (Integer)

Returns:

  • (self)


104
105
106
107
# File 'lib/yoti/doc_scan/session/create/session_specification.rb', line 104

def with_resources_ttl(resources_ttl)
  @resources_ttl = resources_ttl
  self
end

#with_sdk_config(sdk_config) ⇒ self

The SDK configuration set on the session specification

Parameters:

Returns:

  • (self)


166
167
168
169
# File 'lib/yoti/doc_scan/session/create/session_specification.rb', line 166

def with_sdk_config(sdk_config)
  @sdk_config = sdk_config
  self
end

#with_user_tracking_id(user_tracking_id) ⇒ self

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

Parameters:

  • user_tracking_id (String)

Returns:

  • (self)


116
117
118
119
# File 'lib/yoti/doc_scan/session/create/session_specification.rb', line 116

def with_user_tracking_id(user_tracking_id)
  @user_tracking_id = user_tracking_id
  self
end