From 4e2b8aba11bbe2eb1ba7c9925b16ae9e8078f0aa Mon Sep 17 00:00:00 2001 From: Shubhankar Mrinal Date: Wed, 28 Jun 2023 11:27:18 +0530 Subject: [PATCH] sdk initial commit --- CHANGELOG.md | 7 +++++++ plivo/resources/numbers.py | 15 ++++++++++++--- plivo/version.py | 2 +- tests/resources/fixtures/numberGetResponse.json | 1 + tests/resources/fixtures/numberListResponse.json | 3 +++ 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0b6f3fe..0f8c49c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## [4.37.0](https://github.com/plivo/plivo-python/tree/v4.37.0) (2023-06-28) +**Feature - CNAM Storage** +- Added New Param `cnam` in to the response of the [list all numbers API], [list single number API] +- Added `cnam` filter to AccountPhoneNumber - list all my numbers API. +- Added `cnam`, `callback_url`, `callback_method` parameter to buy number[Buy a Phone Number] to configure CNAM storage while buying a US number +- Added `cnam`, `callback_url`, `callback_method` parameter to update number[Update an account phone number] to configure CNAM storage while updating a US number + ## [4.36.0](https://github.com/plivo/plivo-python/tree/v4.36.0) (2023-06-02) **Feature - CNAM Lookup** - Added New Param `cnam_lookup` in to the response of the [list all numbers API], [list single number API] diff --git a/plivo/resources/numbers.py b/plivo/resources/numbers.py index c676dbef..85e8ef84 100644 --- a/plivo/resources/numbers.py +++ b/plivo/resources/numbers.py @@ -16,6 +16,7 @@ class Number(PlivoResource): def delete(self): return self.client.numbers.delete(self.id) + #here to make changes def update(self, app_id=None, subaccount=None, @@ -34,8 +35,12 @@ 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())) @@ -90,6 +95,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( @@ -131,7 +137,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())) diff --git a/plivo/version.py b/plivo/version.py index 985a0626..05640551 100644 --- a/plivo/version.py +++ b/plivo/version.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -__version__ = '4.36.0' +__version__ = '4.37.0' diff --git a/tests/resources/fixtures/numberGetResponse.json b/tests/resources/fixtures/numberGetResponse.json index b625ffa7..4e3ee4d0 100644 --- a/tests/resources/fixtures/numberGetResponse.json +++ b/tests/resources/fixtures/numberGetResponse.json @@ -10,6 +10,7 @@ "number_type": "local", "city": "USA", "cnam_lookup": "enabled", + "cnam": "plivo", "compliance_application_id": null, "compliance_status": null, "country": "United States", diff --git a/tests/resources/fixtures/numberListResponse.json b/tests/resources/fixtures/numberListResponse.json index c341595b..73546bd3 100644 --- a/tests/resources/fixtures/numberListResponse.json +++ b/tests/resources/fixtures/numberListResponse.json @@ -33,6 +33,7 @@ "toll_free_sms_verification": null, "renewal_date": "2014-09-05", "cnam_lookup": "enabled", + "cnam": "plivo", "voice_enabled": true, "voice_rate": "0.00850" }, @@ -61,6 +62,7 @@ "toll_free_sms_verification": null, "renewal_date": "2013-02-01", "cnam_lookup": "enabled", + "cnam": "numbers", "voice_enabled": true, "voice_rate": "0.00850" }, @@ -88,6 +90,7 @@ "toll_free_sms_verification": "verified", "renewal_date": "2013-04-25", "cnam_lookup": "disabled", + "cnam": "plivo12", "voice_enabled": true, "voice_rate": "0.00850" }