Class: Yoti::DocScan::Session::Create::SessionSpecificationBuilder
- Inherits:
-
Object
- Object
- Yoti::DocScan::Session::Create::SessionSpecificationBuilder
- Defined in:
- lib/yoti/doc_scan/session/create/session_specification.rb
Instance Method Summary collapse
- #build ⇒ SessionSpecification
-
#initialize ⇒ SessionSpecificationBuilder
constructor
A new instance of SessionSpecificationBuilder.
-
#with_client_session_token_ttl(client_session_token_ttl) ⇒ self
Client-session-token time-to-live to apply to the created session.
-
#with_notifications(notifications) ⇒ self
For configuring call-back messages.
-
#with_requested_check(requested_check) ⇒ self
The check to be performed on each Document.
-
#with_requested_task(requested_task) ⇒ self
The task to be performed on each Document.
-
#with_required_document(required_document) ⇒ self
Adds a RequiredDocument to the list documents required from the client.
-
#with_resources_ttl(resources_ttl) ⇒ self
Time-to-live used for all Resources created in the course of the session.
-
#with_sdk_config(sdk_config) ⇒ self
The SDK configuration set on the session specification.
-
#with_user_tracking_id(user_tracking_id) ⇒ self
User tracking id, for the Relying Business to track returning users.
Constructor Details
#initialize ⇒ SessionSpecificationBuilder
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
#build ⇒ SessionSpecification
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
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
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
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
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
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
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
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
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 |