From f6f05ab90888979b1e59349d7380e0240eb8427c Mon Sep 17 00:00:00 2001 From: Doug Black Date: Wed, 22 Mar 2017 10:29:39 -0700 Subject: [PATCH] Update client resource helpers --- .../task_queue/test_task_queue_statistics.py | 3 +- .../task_queue/test_task_queues_statistics.py | 3 +- .../v1/workspace/test_workspace_statistics.py | 3 +- .../workflow/test_workflow_statistics.py | 3 +- twilio/rest/__init__.py | 46 +++++++++---------- .../rest/api/v2010/account/call/__init__.py | 8 +++- .../taskrouter/v1/workspace/task/__init__.py | 1 + 7 files changed, 39 insertions(+), 28 deletions(-) diff --git a/tests/integration/taskrouter/v1/workspace/task_queue/test_task_queue_statistics.py b/tests/integration/taskrouter/v1/workspace/task_queue/test_task_queue_statistics.py index 82870e3eea..7c58862c88 100644 --- a/tests/integration/taskrouter/v1/workspace/task_queue/test_task_queue_statistics.py +++ b/tests/integration/taskrouter/v1/workspace/task_queue/test_task_queue_statistics.py @@ -87,7 +87,8 @@ def test_fetch_response(self): "tasks_by_status": { "assigned": 0, "pending": 0, - "reserved": 0 + "reserved": 0, + "wrapping": 0 }, "total_available_workers": 0, "total_eligible_workers": 0, diff --git a/tests/integration/taskrouter/v1/workspace/task_queue/test_task_queues_statistics.py b/tests/integration/taskrouter/v1/workspace/task_queue/test_task_queues_statistics.py index 40ed037f56..3edbd2babb 100644 --- a/tests/integration/taskrouter/v1/workspace/task_queue/test_task_queues_statistics.py +++ b/tests/integration/taskrouter/v1/workspace/task_queue/test_task_queues_statistics.py @@ -97,7 +97,8 @@ def test_read_full_response(self): "tasks_by_status": { "assigned": 0, "pending": 0, - "reserved": 0 + "reserved": 0, + "wrapping": 0 }, "total_available_workers": 0, "total_eligible_workers": 0, diff --git a/tests/integration/taskrouter/v1/workspace/test_workspace_statistics.py b/tests/integration/taskrouter/v1/workspace/test_workspace_statistics.py index b52cd7f775..8cd1d49871 100644 --- a/tests/integration/taskrouter/v1/workspace/test_workspace_statistics.py +++ b/tests/integration/taskrouter/v1/workspace/test_workspace_statistics.py @@ -87,7 +87,8 @@ def test_fetch_response(self): "tasks_by_status": { "assigned": 0, "pending": 0, - "reserved": 0 + "reserved": 0, + "wrapping": 0 }, "total_tasks": 0, "total_workers": 1 diff --git a/tests/integration/taskrouter/v1/workspace/workflow/test_workflow_statistics.py b/tests/integration/taskrouter/v1/workspace/workflow/test_workflow_statistics.py index f9f9d1a175..af59b0d4d2 100644 --- a/tests/integration/taskrouter/v1/workspace/workflow/test_workflow_statistics.py +++ b/tests/integration/taskrouter/v1/workspace/workflow/test_workflow_statistics.py @@ -52,7 +52,8 @@ def test_fetch_response(self): "tasks_by_status": { "assigned": 1, "pending": 0, - "reserved": 0 + "reserved": 0, + "wrapping": 0 }, "total_tasks": 1 }, diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 4e3a1a8f4d..814d4b1599 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -288,161 +288,161 @@ def addresses(self): """ :rtype: twilio.rest.api.v2010.account.address.AddressList """ - return self.account.addresses + return self.api.account.addresses @property def applications(self): """ :rtype: twilio.rest.api.v2010.account.application.ApplicationList """ - return self.account.applications + return self.api.account.applications @property def authorized_connect_apps(self): """ :rtype: twilio.rest.api.v2010.account.authorized_connect_app.AuthorizedConnectAppList """ - return self.account.authorized_connect_apps + return self.api.account.authorized_connect_apps @property def available_phone_numbers(self): """ :rtype: twilio.rest.api.v2010.account.available_phone_number.AvailablePhoneNumberCountryList """ - return self.account.available_phone_numbers + return self.api.account.available_phone_numbers @property def calls(self): """ :rtype: twilio.rest.api.v2010.account.call.CallList """ - return self.account.calls + return self.api.account.calls @property def conferences(self): """ :rtype: twilio.rest.api.v2010.account.conference.ConferenceList """ - return self.account.conferences + return self.api.account.conferences @property def connect_apps(self): """ :rtype: twilio.rest.api.v2010.account.connect_app.ConnectAppList """ - return self.account.connect_apps + return self.api.account.connect_apps @property def incoming_phone_numbers(self): """ :rtype: twilio.rest.api.v2010.account.incoming_phone_number.IncomingPhoneNumberList """ - return self.account.incoming_phone_numbers + return self.api.account.incoming_phone_numbers @property def keys(self): """ :rtype: twilio.rest.api.v2010.account.key.KeyList """ - return self.account.keys + return self.api.account.keys @property def messages(self): """ :rtype: twilio.rest.api.v2010.account.message.MessageList """ - return self.account.messages + return self.api.account.messages @property def new_keys(self): """ :rtype: twilio.rest.api.v2010.account.new_key.NewKeyList """ - return self.account.new_keys + return self.api.account.new_keys @property def new_signing_keys(self): """ :rtype: twilio.rest.api.v2010.account.new_signing_key.NewSigningKeyList """ - return self.account.new_signing_keys + return self.api.account.new_signing_keys @property def notifications(self): """ :rtype: twilio.rest.api.v2010.account.notification.NotificationList """ - return self.account.notifications + return self.api.account.notifications @property def outgoing_caller_ids(self): """ :rtype: twilio.rest.api.v2010.account.outgoing_caller_id.OutgoingCallerIdList """ - return self.account.outgoing_caller_ids + return self.api.account.outgoing_caller_ids @property def queues(self): """ :rtype: twilio.rest.api.v2010.account.queue.QueueList """ - return self.account.queues + return self.api.account.queues @property def recordings(self): """ :rtype: twilio.rest.api.v2010.account.recording.RecordingList """ - return self.account.recordings + return self.api.account.recordings @property def signing_keys(self): """ :rtype: twilio.rest.api.v2010.account.signing_key.SigningKeyList """ - return self.account.signing_keys + return self.api.account.signing_keys @property def sip(self): """ :rtype: twilio.rest.api.v2010.account.sip.SipList """ - return self.account.sip + return self.api.account.sip @property def short_codes(self): """ :rtype: twilio.rest.api.v2010.account.short_code.ShortCodeList """ - return self.account.short_codes + return self.api.account.short_codes @property def tokens(self): """ :rtype: twilio.rest.api.v2010.account.token.TokenList """ - return self.account.tokens + return self.api.account.tokens @property def transcriptions(self): """ :rtype: twilio.rest.api.v2010.account.transcription.TranscriptionList """ - return self.account.transcriptions + return self.api.account.transcriptions @property def usage(self): """ :rtype: twilio.rest.api.v2010.account.usage.UsageList """ - return self.account.usage + return self.api.account.usage @property def validation_requests(self): """ :rtype: twilio.rest.api.v2010.account.validation_request.ValidationRequestList """ - return self.account.validation_requests + return self.api.account.validation_requests def __repr__(self): """ diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index 00b3dc4664..adfdc16cea 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -51,7 +51,9 @@ def create(self, to, from_, method=values.unset, fallback_url=values.unset, recording_status_callback=values.unset, recording_status_callback_method=values.unset, sip_auth_username=values.unset, sip_auth_password=values.unset, - url=values.unset, application_sid=values.unset): + machine_detection=values.unset, + machine_detection_timeout=values.unset, url=values.unset, + application_sid=values.unset): """ Create a new CallInstance @@ -72,6 +74,8 @@ def create(self, to, from_, method=values.unset, fallback_url=values.unset, :param unicode recording_status_callback_method: The recording_status_callback_method :param unicode sip_auth_username: The sip_auth_username :param unicode sip_auth_password: The sip_auth_password + :param unicode machine_detection: Enable machine detection or end of greeting detection + :param unicode machine_detection_timeout: Number of miliseconds to wait for machine detection :param unicode url: Url from which to fetch TwiML :param unicode application_sid: ApplicationSid that configures from where to fetch TwiML @@ -98,6 +102,8 @@ def create(self, to, from_, method=values.unset, fallback_url=values.unset, 'RecordingStatusCallbackMethod': recording_status_callback_method, 'SipAuthUsername': sip_auth_username, 'SipAuthPassword': sip_auth_password, + 'MachineDetection': machine_detection, + 'MachineDetectionTimeout': machine_detection_timeout, }) payload = self._version.create( diff --git a/twilio/rest/taskrouter/v1/workspace/task/__init__.py b/twilio/rest/taskrouter/v1/workspace/task/__init__.py index a920f1805a..44b6e015e5 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task/__init__.py @@ -419,6 +419,7 @@ class Status(object): ASSIGNED = "assigned" CANCELED = "canceled" COMPLETED = "completed" + WRAPPING = "wrapping" def __init__(self, version, payload, workspace_sid, sid=None): """