Skip to content

Commit

Permalink
Merge pull request #193 from plivo/PHONUM-2430
Browse files Browse the repository at this point in the history
PHONUM-2430
  • Loading branch information
kalyan-plivo authored Oct 14, 2022
2 parents b5d6a3b + 50e0b67 commit 7161488
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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**
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 18 additions & 3 deletions lib/plivo/resources/numbers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -205,14 +211,23 @@ 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?

valid_param?(:options, options, Hash, true)

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]
Expand Down
2 changes: 1 addition & 1 deletion lib/plivo/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Plivo
VERSION = "4.30.2".freeze
VERSION = "4.31.0".freeze
end
5 changes: 4 additions & 1 deletion spec/mocks/numberGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
17 changes: 13 additions & 4 deletions spec/mocks/numberListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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"
}
]
}
5 changes: 4 additions & 1 deletion spec/resource_numbers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7161488

Please sign in to comment.