From dc553c4c880616cd97b7b8aacab024bb8bd25369 Mon Sep 17 00:00:00 2001 From: kapilp93 Date: Tue, 27 Sep 2022 13:24:06 +0530 Subject: [PATCH 1/5] 10dlc and tollfree related new fields in list and get numberS --- lib/plivo/resources/numbers.rb | 21 ++++++++++++++++++--- spec/resource_numbers_spec.rb | 4 +++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/lib/plivo/resources/numbers.rb b/lib/plivo/resources/numbers.rb index 91943def..f3531286 100644 --- a/lib/plivo/resources/numbers.rb +++ b/lib/plivo/resources/numbers.rb @@ -33,7 +33,10 @@ def to_s sms_enabled: @sms_enabled, sms_rate: @sms_rate, voice_enabled: @voice_enabled, - voice_rate: @voice_rate + voice_rate: @voice_rate, + tendlc_campaign_id: @tendlc_campaign_id, + tendlc_registration_status: @tendlc_registration_status, + toll_free_sms_verification: @toll_free_sms_verification }.to_s end end @@ -176,7 +179,10 @@ def to_s sms_rate: @sms_rate, sub_account: @sub_account, voice_enabled: @voice_enabled, - voice_rate: @voice_rate + voice_rate: @voice_rate, + tendlc_campaign_id: @tendlc_campaign_id, + tendlc_registration_status: @tendlc_registration_status, + toll_free_sms_verification: @toll_free_sms_verification }.to_s end end @@ -205,6 +211,15 @@ def get(number) # - sms - Returns a list of numbers that provide only 'sms' services. # @option options [Int] :limit Used to display the number of results per page. The maximum number of results that can be fetched is 20. # @option options [Int] :offset Denotes the number of value items by which the results should be offset. Eg:- If the result contains a 1000 values and limit is set to 10 and offset is set to 705, then values 706 through 715 are displayed in the results. This parameter is also used for pagination of the results. + # @option options [String] :tendlc_campaign_id The 10DLC campaign that the number is currently linked with. You can filter US/CA local numbers linked to a specific campaign. + # @option options [String] :tendlc_registration_status Indicates the 10DLC registration status of a US/CA local number. The following values are valid: + # - unregistered - Returns a list of numbers that are not linked to any campaign + # - processing - Returns a list of numbers that are currently in the process of being linked to respective campaigns. + # - completed - Returns a list of numbers that are successfully linked to respective campaigns. + # @option options [String] :toll_free_sms_verification Indicates the toll-free SMS verification status of SMS-enabled US/CA toll-free number. The following values are valid: + # - unverified - Returns a list of SMS-enabled US/CA toll-free numbers that are not verified. + # - pending_verification - Returns a list of SMS-enabled US/CA toll-free numbers that are pending verification + # - verified - Returns a list of SMS-enabled US/CA toll-free numbers that are verified for enhanced outbound SMS limits. def list(options = nil) return perform_list if options.nil? @@ -212,7 +227,7 @@ def list(options = nil) params = {} - %i[number_startswith subaccount alias].each do |param| + %i[number_startswith subaccount alias tendlc_campaign_id tendlc_registration_status toll_free_sms_verification].each do |param| if options.key?(param) && valid_param?(param, options[param], [String, Symbol], true) params[param] = options[param] diff --git a/spec/resource_numbers_spec.rb b/spec/resource_numbers_spec.rb index f0b9b024..f9ef10f7 100644 --- a/spec/resource_numbers_spec.rb +++ b/spec/resource_numbers_spec.rb @@ -17,7 +17,9 @@ def to_json(number) sms_rate: number.sms_rate, sub_account: number.sub_account, voice_enabled: number.voice_enabled, - voice_rate: number.voice_rate + tendlc_campaign_id: number.tendlc_campaign_id, + tendlc_registration_status: number.tendlc_registration_status, + toll_free_sms_verification: number.toll_free_sms_verification }.to_json end From 03c93ab51fb426b718571663c5cdb131047290a6 Mon Sep 17 00:00:00 2001 From: kapilp93 Date: Fri, 14 Oct 2022 13:59:17 +0530 Subject: [PATCH 2/5] added 10dlc and tollfree fields in mock response --- spec/mocks/numberGetResponse.json | 5 ++++- spec/mocks/numberListResponse.json | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/spec/mocks/numberGetResponse.json b/spec/mocks/numberGetResponse.json index a0b9b9c6..e11dde9e 100644 --- a/spec/mocks/numberGetResponse.json +++ b/spec/mocks/numberGetResponse.json @@ -13,5 +13,8 @@ "sms_rate": "0.00000", "sub_account": null, "voice_enabled": true, - "voice_rate": "0.00850" + "voice_rate": "0.00850", + "tendlc_campaign_id": "ACB1234", + "tendlc_registration_status": "COMPLETED", + "toll_free_sms_verification": "verified" } \ No newline at end of file diff --git a/spec/mocks/numberListResponse.json b/spec/mocks/numberListResponse.json index 16fd38e5..31b78988 100644 --- a/spec/mocks/numberListResponse.json +++ b/spec/mocks/numberListResponse.json @@ -22,7 +22,10 @@ "sms_rate": "0.00000", "sub_account": null, "voice_enabled": true, - "voice_rate": "0.00850" + "voice_rate": "0.00850", + "tendlc_campaign_id": "ACB1234", + "tendlc_registration_status": "COMPLETED", + "toll_free_sms_verification": "verified" }, { "added_on": "2013-01-01", @@ -38,7 +41,10 @@ "sms_rate": "0.00000", "sub_account": null, "voice_enabled": true, - "voice_rate": "0.00850" + "voice_rate": "0.00850", + "tendlc_campaign_id": "ACB1234", + "tendlc_registration_status": "COMPLETED", + "toll_free_sms_verification": "verified" }, { "added_on": "2013-03-25", @@ -54,7 +60,10 @@ "sms_rate": "0.00000", "sub_account": null, "voice_enabled": true, - "voice_rate": "0.00850" + "voice_rate": "0.00850", + "tendlc_campaign_id": "ACB1234", + "tendlc_registration_status": "COMPLETED", + "toll_free_sms_verification": "verified" } ] } \ No newline at end of file From 0419a017d1cf1456b6e1a7d864aa25db67b4e394 Mon Sep 17 00:00:00 2001 From: kalyan-plivo Date: Fri, 14 Oct 2022 18:40:23 +0530 Subject: [PATCH 3/5] bumping the version --- CHANGELOG.md | 5 +++++ README.md | 2 +- lib/plivo/version.rb | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eaafde41..fcf6bc50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # Change Log +## [4.31.0](https://github.com/plivo/plivo-ruby/tree/v4.31.0) (2022-10-14) +**Adding new attributes to Account PhoneNumber object** +-Added 3 new keys to AccountPhoneNumber object:`tendlc_registration_status`, `tendlc_campaign_id` and `toll_free_sms_verification` (https://www.plivo.com/docs/numbers/api/account-phone-number#the-accountphonenumber-object) +-Added 3 new filters to AccountPhoneNumber - list all my numbers API:`tendlc_registration_status`, `tendlc_campaign_id` and `toll_free_sms_verification` (https://www.plivo.com/docs/numbers/api/account-phone-number#list-all-my-numbers) + ## [4.30.2](https://github.com/plivo/plivo-ruby/tree/v4.30.2) (2022-09-28) **10DLC: Campaign request** diff --git a/README.md b/README.md index 9181a79d..54448354 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The Plivo Ruby SDK makes it simpler to integrate communications into your Ruby a Add this line to your application's Gemfile: ```ruby -gem 'plivo', '>= 4.30.2' +gem 'plivo', '>= 4.31.0' ``` And then execute: diff --git a/lib/plivo/version.rb b/lib/plivo/version.rb index c97ae217..5af3e350 100644 --- a/lib/plivo/version.rb +++ b/lib/plivo/version.rb @@ -1,3 +1,3 @@ module Plivo - VERSION = "4.30.2".freeze + VERSION = "4.31.0".freeze end From 7ac22aef0f0c1498a55435a68c318afc4226bbcc Mon Sep 17 00:00:00 2001 From: kalyan-plivo Date: Fri, 14 Oct 2022 18:50:26 +0530 Subject: [PATCH 4/5] corrected the uts --- spec/mocks/numberGetResponse.json | 2 +- spec/mocks/numberListResponse.json | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/mocks/numberGetResponse.json b/spec/mocks/numberGetResponse.json index e11dde9e..ef840fcb 100644 --- a/spec/mocks/numberGetResponse.json +++ b/spec/mocks/numberGetResponse.json @@ -16,5 +16,5 @@ "voice_rate": "0.00850", "tendlc_campaign_id": "ACB1234", "tendlc_registration_status": "COMPLETED", - "toll_free_sms_verification": "verified" + "toll_free_sms_verification": null } \ No newline at end of file diff --git a/spec/mocks/numberListResponse.json b/spec/mocks/numberListResponse.json index 31b78988..ba890cdb 100644 --- a/spec/mocks/numberListResponse.json +++ b/spec/mocks/numberListResponse.json @@ -25,7 +25,7 @@ "voice_rate": "0.00850", "tendlc_campaign_id": "ACB1234", "tendlc_registration_status": "COMPLETED", - "toll_free_sms_verification": "verified" + "toll_free_sms_verification": null }, { "added_on": "2013-01-01", @@ -44,7 +44,7 @@ "voice_rate": "0.00850", "tendlc_campaign_id": "ACB1234", "tendlc_registration_status": "COMPLETED", - "toll_free_sms_verification": "verified" + "toll_free_sms_verification": null }, { "added_on": "2013-03-25", @@ -53,7 +53,7 @@ "carrier": "Plivo", "monthly_rental_rate": "0.80000", "number": "14152753408", - "number_type": "local", + "number_type": "tollfree", "region": "California, UNITED STATES", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Number/14152753408/", "sms_enabled": true, @@ -61,8 +61,8 @@ "sub_account": null, "voice_enabled": true, "voice_rate": "0.00850", - "tendlc_campaign_id": "ACB1234", - "tendlc_registration_status": "COMPLETED", + "tendlc_campaign_id": null, + "tendlc_registration_status": null, "toll_free_sms_verification": "verified" } ] From 50e0b6799ed44d2636333d4cfbd2795e21d501fb Mon Sep 17 00:00:00 2001 From: kalyan-plivo Date: Fri, 14 Oct 2022 18:55:58 +0530 Subject: [PATCH 5/5] fix uts --- spec/resource_numbers_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/resource_numbers_spec.rb b/spec/resource_numbers_spec.rb index f9ef10f7..e82a231b 100644 --- a/spec/resource_numbers_spec.rb +++ b/spec/resource_numbers_spec.rb @@ -17,6 +17,7 @@ def to_json(number) sms_rate: number.sms_rate, sub_account: number.sub_account, voice_enabled: number.voice_enabled, + voice_rate: number.voice_rate, tendlc_campaign_id: number.tendlc_campaign_id, tendlc_registration_status: number.tendlc_registration_status, toll_free_sms_verification: number.toll_free_sms_verification