Skip to content
Open
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
13 changes: 10 additions & 3 deletions plivo/resources/numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ def __init__(self, client):
number=[is_phonenumber()],
app_id=[optional(of_type(six.text_type))],
verification_info=[optional(of_type_exact(dict))],
cnam_lookup=[optional(of_type(six.text_type))],)
def buy(self, number, app_id=None, verification_info=None, cnam_lookup=None):
cnam_lookup=[optional(of_type(six.text_type))],
cnam=[optional(of_type(six.text_type))],
callback_url=[optional(of_type(six.text_type))],
callback_method=[optional(of_type(six.text_type))],)
def buy(self, number, app_id=None, verification_info=None, cnam_lookup=None, cnam=None, callback_url=None, callback_method=None):
return self.client.request('POST', ('PhoneNumber', number),
to_param_dict(self.buy, locals()))

Expand Down Expand Up @@ -90,6 +93,7 @@ def list(self,
renewal_date__gte=None,
renewal_date__gt=None,
cnam_lookup=None,
cnam=None,
limit=20,
offset=0):
return self.client.request(
Expand Down Expand Up @@ -131,7 +135,10 @@ def update(self,
subaccount=None,
alias=None,
verification_info=None,
cnam_lookup=None,):
cnam_lookup=None,
cnam=None,
callback_url=None,
callback_method=None,):
return self.client.request('POST', ('Number', number),
to_param_dict(self.update, locals()))

Expand Down
1 change: 1 addition & 0 deletions tests/resources/fixtures/numberGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"number": "17609915566",
"number_type": "local",
"city": "USA",
"cnam": "plivo",
"cnam_lookup": "enabled",
"compliance_application_id": null,
"compliance_status": null,
Expand Down
3 changes: 3 additions & 0 deletions tests/resources/fixtures/numberListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"tendlc_registration_status": "PROCESSING",
"toll_free_sms_verification": null,
"renewal_date": "2014-09-05",
"cnam": "plivo",
"cnam_lookup": "enabled",
"voice_enabled": true,
"voice_rate": "0.00850"
Expand Down Expand Up @@ -60,6 +61,7 @@
"tendlc_registration_status": "REGISTERED",
"toll_free_sms_verification": null,
"renewal_date": "2013-02-01",
"cnam": "",
"cnam_lookup": "enabled",
"voice_enabled": true,
"voice_rate": "0.00850"
Expand Down Expand Up @@ -87,6 +89,7 @@
"tendlc_registration_status": null,
"toll_free_sms_verification": "verified",
"renewal_date": "2013-04-25",
"cnam": "plivo",
"cnam_lookup": "disabled",
"voice_enabled": true,
"voice_rate": "0.00850"
Expand Down