8000 Add Queue and Queue Member API reference · skyl/twilio-python@aeefacc · GitHub
[go: up one dir, main page]

Skip to content

Commit aeefacc

Browse files
committed
Add Queue and Queue Member API reference
1 parent d8be3e1 commit aeefacc

File tree

2 files changed

+91
-1
lines changed

2 files changed

+91
-1
lines changed

docs/api/rest/resources.rst

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,74 @@ Phone Numbers
603603
.. attribute:: iso_country
604604

605605

606+
Queues
607+
>>>>>>>>>>>
608+
609+
.. autoclass:: twilio.rest.resources.Queues
610+
:members:
611+
:exclude-members: instance
612+
613+
.. autoclass:: twilio.rest.resources.Queue
614+
:members:
615+
616+
.. attribute:: sid
617+
618+
A 34 character string that uniquely identifies this queue.
619+
620+
.. attribute:: friendly_name
621+
622+
A user-provided string that identifies this queue.
623+
624+
.. attribute:: current_size
625+
626+
The count of calls currently in the queue.
627+
628+
.. attribute:: max_size
629+
630+
The upper limit of calls allowed to be in the queue.
631+
`unlimited` is an option. The default is 100.
632+
633+
.. attribute:: average_wait_time
634+
635+
The average wait time of the members of this queue in seconds.
636+
This is calculated at the time of the request.
637+
638+
.. attribute:: uri
639+
640+
The URI for this resource, relative to https://api.twilio.com.
641+
642+
643+
Queue Members
644+
>>>>>>>>>>>>>>
645+
646+
.. autoclass:: twilio.rest.resources.Members
647+
:members:
648+
:exclude-members: instance
649+
650+
.. autoclass:: twilio.rest.resources.Member
651+
:members:
652+
653+
.. attribute:: call_sid
654+
655+
A 34 character string that uniquely identifies the call that is enqueued.
656+
657+
.. attribute:: date_enqueued
658+
659+
The date that the member was enqueued, given in RFC 2822 format.
660+
661+
.. attribute:: wait_time
662+
663+
The number of seconds the member has been in the queue.
664+
665+
.. attribute:: position
666+
667+
This member’s current position in the queue.
668+
669+
.. attribute:: uri
670+
671+
The URI for this resource, relative to https://api.twilio.com.
672+
673+
606674
Recordings
607675
>>>>>>>>>>>
608676

twilio/rest/resources.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,7 @@ class Queue(InstanceResource):
11851185
def update(self, **kwargs):
11861186
"""
11871187
Update this queue
1188+
11881189
:param friendly_name: A new friendly name for this queue
11891190
:param max_size: A new max size. Changing a max size to less than the
11901191
current size results in the queue rejecting incoming
@@ -1208,13 +1209,34 @@ def list(self, **kwargs):
12081209

12091210
def create(self, name, **kwargs):
12101211
""" Create an :class:`Queue` with any of these optional parameters.
1212+
12111213
:param name: A human readable description of the application,
12121214
with maximum length 64 characters.
12131215
:param max_size: The limit on calls allowed into the queue (optional)
12141216
"""
12151217
kwargs['friendly_name'] = name
12161218
return self.create_instance(kwargs)
12171219

1220+
def update(self, sid, **kwargs):
1221+
"""
1222+
Update a :class:`Queue`
1223+
1224+
:param sid: String identifier for a Queue resource
1225+
:param friendly_name: A new friendly name for this queue
1226+
:param max_size: A new max size. Changing a max size to less than the
1227+
current size results in the queue rejecting incoming
1228+
requests until it shrinks below the new max size
1229+
"""
1230+
return self.update_instance(sid, kwargs)
1231+
1232+
def delete(self, sid):
1233+
"""
1234+
Delete a :class:`Queue`. Can only be run on empty queues.
1235+
1236+
:param sid: String identifier for a Queue resource
1237+
"""
1238+
return self.delete_instance(sid)
1239+
12181240

12191241
class 7222 Application(InstanceResource):
12201242
""" An application resource """
@@ -1302,7 +1324,7 @@ def update(self, sid, **kwargs):
13021324

13031325
def delete(self, sid):
13041326
"""
1305-
Update an :class:`Application` with the given parameters.
1327+
Delete an :class:`Application`
13061328
"""
13071329
return self.delete_instance(sid)
13081330

0 commit comments

Comments
 (0)
0