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/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/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 diff --git a/spec/mocks/numberGetResponse.json b/spec/mocks/numberGetResponse.json index a0b9b9c6..ef840fcb 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": null } \ No newline at end of file diff --git a/spec/mocks/numberListResponse.json b/spec/mocks/numberListResponse.json index 16fd38e5..ba890cdb 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": null }, { "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": null }, { "added_on": "2013-03-25", @@ -47,14 +53,17 @@ "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, "sms_rate": "0.00000", "sub_account": null, "voice_enabled": true, - "voice_rate": "0.00850" + "voice_rate": "0.00850", + "tendlc_campaign_id": null, + "tendlc_registration_status": null, + "toll_free_sms_verification": "verified" } ] } \ No newline at end of file diff --git a/spec/resource_numbers_spec.rb b/spec/resource_numbers_spec.rb index f0b9b024..e82a231b 100644 --- a/spec/resource_numbers_spec.rb +++ b/spec/resource_numbers_spec.rb @@ -17,7 +17,10 @@ def to_json(number) sms_rate: number.sms_rate, sub_account: number.sub_account, voice_enabled: number.voice_enabled, - voice_rate: number.voice_rate + 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