class Yoti::DocScan::Session::Create::NotificationConfigBuilder

Public Class Methods

new() click to toggle source
# File lib/yoti/doc_scan/session/create/notification_config.rb, line 55
def initialize
  @topics = []
end

Public Instance Methods

build() click to toggle source

@return [NotificationConfig]

# File lib/yoti/doc_scan/session/create/notification_config.rb, line 135
def build
  NotificationConfig.new(@auth_token, @endpoint, @topics)
end
for_check_completion() click to toggle source

Adds CHECK_COMPLETION to the list of topics that trigger notification messages

@return [self]

# File lib/yoti/doc_scan/session/create/notification_config.rb, line 119
def for_check_completion
  with_topic(Constants::CHECK_COMPLETION)
end
for_resource_update() click to toggle source

Adds RESOURCE_UPDATE to the list of topics that trigger notification messages

@return [self]

# File lib/yoti/doc_scan/session/create/notification_config.rb, line 101
def for_resource_update
  with_topic(Constants::RESOURCE_UPDATE)
end
for_session_completion() click to toggle source

Adds SESSION_COMPLETION to the list of topics that trigger notification messages

@return [self]

# File lib/yoti/doc_scan/session/create/notification_config.rb, line 128
def for_session_completion
  with_topic(Constants::SESSION_COMPLETION)
end
for_task_completion() click to toggle source

Adds TASK_COMPLETION to the list of topics that trigger notification messages

@return [self]

# File lib/yoti/doc_scan/session/create/notification_config.rb, line 110
def for_task_completion
  with_topic(Constants::TASK_COMPLETION)
end
with_auth_token(auth_token) click to toggle source

Sets the authorization token to be included in call-back messages

@param [String] auth_token

@return [self]

# File lib/yoti/doc_scan/session/create/notification_config.rb, line 66
def with_auth_token(auth_token)
  @auth_token = auth_token
  self
end
with_endpoint(endpoint) click to toggle source

Sets the endpoint that notifications should be sent to

@param [String] endpoint

@return [self]

# File lib/yoti/doc_scan/session/create/notification_config.rb, line 78
def with_endpoint(endpoint)
  @endpoint = endpoint
  self
end
with_topic(topic) click to toggle source

Adds a topic to the list of topics that trigger notification messages

@param [String] topic

@return [self]

# File lib/yoti/doc_scan/session/create/notification_config.rb, line 90
def with_topic(topic)
  Validation.assert_is_a(String, topic, 'topic')
  @topics.push(topic)
  self
end