8000 Update client resource helpers by dougblack · Pull Request #320 · twilio/twilio-python · GitHub
[go: up one dir, main page]

Skip to content

Update client resource helpers #320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update client resource helpers
  • Loading branch information
Doug Black committed Mar 22, 2017
commit f6f05ab90888979b1e59349d7380e0240eb8427c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
46 changes: 23 additions & 23 deletions twilio/rest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
8 changes: 7 additions & 1 deletion twilio/rest/api/v2010/account/call/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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(
Expand Down
1 change: 1 addition & 0 deletions twilio/rest/taskrouter/v1/workspace/task/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ class Status(object):
ASSIGNED = "assigned"
CANCELED = "canceled"
COMPLETED = "completed"
WRAPPING = "wrapping"

def __init__(self, version, payload, workspace_sid, sid=None):
"""
Expand Down
0