lib/twilio-ruby/jwt/access_token.rb in twilio-ruby-5.0.0.rc19 vs lib/twilio-ruby/jwt/access_token.rb in twilio-ruby-5.0.0.rc20
- old
+ new
@@ -185,9 +185,37 @@
payload
end
end
+ class TaskRouterGrant
+ attr_accessor :workspace_sid,
+ :worker_sid,
+ :role
+
+ def key
+ 'task_router'
+ end
+
+ def payload
+ payload = {}
+
+ if workspace_sid
+ payload[:workspace_sid] = workspace_sid
+ end
+
+ if worker_sid
+ payload[:worker_sid] = worker_sid
+ end
+
+ if role
+ payload[:role] = role
+ end
+
+ payload
+ end
+ end
+
end
end
end