Class: TwilioBase::TaskRouter::Workspace

Inherits:
Object
  • Object
show all
Extended by:
Clients
Defined in:
app/services/twilio_base/task_router/workspace.rb

Constant Summary collapse

DEFAULT_TEMPLATE =
'FIFO'
REQUIRED_EVENTS =
%w[
  task.canceled
  task.completed
  task.updated
  workflow.timeout
].freeze

Constants included from Clients

Clients::ACCOUNT_SID, Clients::AUTH_TOKEN

Class Method Summary collapse

Methods included from Clients

chat_client, config, rest_client, sms_client

Class Method Details

.create(friendly_name:) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'app/services/twilio_base/task_router/workspace.rb', line 17

def create(friendly_name:)
  workspace_client.create(
    event_callback_url: event_callback_url,
    events_filter: events,
    friendly_name: friendly_name,
    multi_task_enabled: true,
    template: DEFAULT_TEMPLATE
  )
end

.find(sid) ⇒ Object



27
28
29
# File 'app/services/twilio_base/task_router/workspace.rb', line 27

def find(sid)
  workspace_client(sid)
end