class Twilio::JWT::TaskRouterCapability::TaskRouterUtils

Constants

TASK_ROUTER_BASE_URL
TASK_ROUTER_VERSION
TASK_ROUTER_WEBSOCKET_BASE_URL

Public Class Methods

activities(workspace_sid) click to toggle source
    # File lib/twilio-ruby/jwt/task_router.rb
119 def self.activities(workspace_sid)
120   [workspace(workspace_sid), 'Activities'].join('/')
121 end
activity(workspace_sid, activity_sid) click to toggle source
    # File lib/twilio-ruby/jwt/task_router.rb
123 def self.activity(workspace_sid, activity_sid)
124   [workspace(workspace_sid), 'Activities', activity_sid].join('/')
125 end
all_activities(workspace_sid) click to toggle source
    # File lib/twilio-ruby/jwt/task_router.rb
127 def self.all_activities(workspace_sid)
128   [workspace(workspace_sid), 'Activities', '**'].join('/')
129 end
all_reservations(workspace_sid, worker_sid) click to toggle source
    # File lib/twilio-ruby/jwt/task_router.rb
151 def self.all_reservations(workspace_sid, worker_sid)
152   [worker(workspace_sid, worker_sid), 'Reservations', '**'].join('/')
153 end
all_task_queues(workspace_sid) click to toggle source
    # File lib/twilio-ruby/jwt/task_router.rb
115 def self.all_task_queues(workspace_sid)
116   [workspace(workspace_sid), 'TaskQueues', '**'].join('/')
117 end
all_tasks(workspace_sid) click to toggle source
    # File lib/twilio-ruby/jwt/task_router.rb
103 def self.all_tasks(workspace_sid)
104   [workspace(workspace_sid), 'Tasks', '**'].join('/')
105 end
all_workers(workspace_sid) click to toggle source
    # File lib/twilio-ruby/jwt/task_router.rb
139 def self.all_workers(workspace_sid)
140   [workspace(workspace_sid), 'Workers', '**'].join('/')
141 end
all_workspaces() click to toggle source
   # File lib/twilio-ruby/jwt/task_router.rb
91 def self.all_workspaces
92   [TASK_ROUTER_BASE_URL, TASK_ROUTER_VERSION, 'Workspaces', '**'].join('/')
93 end
reservation(workspace_sid, worker_sid, reservation_sid) click to toggle source
    # File lib/twilio-ruby/jwt/task_router.rb
147 def self.reservation(workspace_sid, worker_sid, reservation_sid)
148   [worker(workspace_sid, worker_sid), 'Reservations', reservation_sid].join('/')
149 end
reservations(workspace_sid, worker_sid) click to toggle source
    # File lib/twilio-ruby/jwt/task_router.rb
143 def self.reservations(workspace_sid, worker_sid)
144   [worker(workspace_sid, worker_sid), 'Reservations'].join('/')
145 end
task(workspace_sid, tasks_sid) click to toggle source
    # File lib/twilio-ruby/jwt/task_router.rb
 99 def self.task(workspace_sid, tasks_sid)
100   [workspace(workspace_sid), 'Tasks', tasks_sid].join('/')
101 end
task_queue(workspace_sid, taskqueue_sid) click to toggle source
    # File lib/twilio-ruby/jwt/task_router.rb
111 def self.task_queue(workspace_sid, taskqueue_sid)
112   [workspace(workspace_sid), 'TaskQueues', taskqueue_sid].join('/')
113 end
task_queues(workspace_sid) click to toggle source
    # File lib/twilio-ruby/jwt/task_router.rb
107 def self.task_queues(workspace_sid)
108   [workspace(workspace_sid), 'TaskQueues'].join('/')
109 end
tasks(workspace_sid) click to toggle source
   # File lib/twilio-ruby/jwt/task_router.rb
95 def self.tasks(workspace_sid)
96   [workspace(workspace_sid), 'Tasks'].join('/')
97 end
web_socket_policies(account_sid, channel_sid) click to toggle source
    # File lib/twilio-ruby/jwt/task_router.rb
155 def self.web_socket_policies(account_sid, channel_sid)
156   url = [TASK_ROUTER_WEBSOCKET_BASE_URL, account_sid, channel_sid].join('/')
157   get = Policy.new(url, 'GET', true)
158   post = Policy.new(url, 'POST', true)
159   [get, post]
160 end
worker(workspace_sid, worker_sid) click to toggle source
    # File lib/twilio-ruby/jwt/task_router.rb
135 def self.worker(workspace_sid, worker_sid)
136   [workspace(workspace_sid), 'Workers', worker_sid].join('/')
137 end
worker_policies(workspace_sid, worker_sid) click to toggle source
    # File lib/twilio-ruby/jwt/task_router.rb
162 def self.worker_policies(workspace_sid, worker_sid)
163   activities = Policy.new(self.activities(workspace_sid), 'GET', true)
164   tasks = Policy.new(all_tasks(workspace_sid), 'GET', true)
165   reservations = Policy.new(all_reservations(workspace_sid, worker_sid), 'GET', true)
166   fetch = Policy.new(worker(workspace_sid, worker_sid), 'GET', true)
167   [activities, tasks, reservations, fetch]
168 end
workers(workspace_sid) click to toggle source
    # File lib/twilio-ruby/jwt/task_router.rb
131 def self.workers(workspace_sid)
132   [workspace(workspace_sid), 'Workers'].join('/')
133 end
workspace(workspace_sid) click to toggle source
   # File lib/twilio-ruby/jwt/task_router.rb
87 def self.workspace(workspace_sid)
88   [TASK_ROUTER_BASE_URL, TASK_ROUTER_VERSION, 'Workspaces', workspace_sid].join('/')
89 end
workspaces() click to toggle source
   # File lib/twilio-ruby/jwt/task_router.rb
83 def self.workspaces
84   [TASK_ROUTER_BASE_URL, TASK_ROUTER_VERSION, 'Workspaces'].join('/')
85 end