Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new params #207

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
18e190f
extending messgaing filter
narayana-plivo Jan 17, 2023
8af947e
version upgrade
narayana-plivo Feb 22, 2023
5b0ba9f
Added new params
anindya-plivo Feb 24, 2023
57566fa
changed UT
anindya-plivo Feb 24, 2023
d370b81
changed UT
anindya-plivo Feb 24, 2023
4a728d0
Merge branch 'master' into messaging-list-ext
narayana-plivo Feb 27, 2023
25558e5
Merge pull request #203 from plivo/messaging-list-ext
narayana-plivo Feb 27, 2023
0905f3c
bug fix
narayana-plivo Feb 28, 2023
91096c1
Merge pull request #208 from plivo/bug-fix-messaging-object
narayana-plivo Feb 28, 2023
c59913c
SMS-4946/SMS-4848: adding new param 'is_domestic' in Get Message and …
saurabhnewatiya-plivo Feb 22, 2023
629eec6
Merge pull request #206 from plivo/SMS-4946
narayana-plivo Mar 3, 2023
950836e
bulk message fix
narayana-plivo Mar 6, 2023
5dccd39
Merge pull request #210 from plivo/bulk_send_sms_fix
narayana-plivo Mar 6, 2023
d896ff0
Added new params
anindya-plivo Feb 24, 2023
9634314
changed UT
anindya-plivo Feb 24, 2023
88e01b0
changed UT
anindya-plivo Feb 24, 2023
f95437f
changed version
anindya-plivo Mar 8, 2023
37ec873
Merge remote-tracking branch 'origin/VT-5270' into VT-5270
anindya-plivo Mar 8, 2023
e37d230
local docker enhancement
mohsin-plivo Mar 9, 2023
0dc474c
Adding CreatedAt field in get and list brand/profile api
Mar 14, 2023
77cec48
Adding created_at field in list and get campaign details api response
Mar 16, 2023
0848aa3
Merge pull request #211 from plivo/local-docker-enhancement
renoldthomas-plivo Mar 17, 2023
b60f97e
version update
Mar 17, 2023
973ef79
date change
Mar 17, 2023
5a166a1
version update
Mar 17, 2023
02f90df
Merge pull request #212 from plivo/SMS-5098-10DLC-management-experien…
narayana-plivo Mar 17, 2023
b0535fd
Added new params
anindya-plivo Feb 24, 2023
99112d8
changed UT
anindya-plivo Feb 24, 2023
4e857b7
changed UT
anindya-plivo Feb 24, 2023
70789a1
changed version
anindya-plivo Mar 8, 2023
11ca805
Merge remote-tracking branch 'origin/VT-5270' into VT-5270
anindya-plivo Apr 5, 2023
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
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
# Change Log
## [4.39.1](https://github.com/plivo/plivo-ruby/tree/v4.39.1) (2023-04-04)
**Feature - Recording API changes**
- Added `monthly_recording_storage_amount`, `recording_storage_rate`, `rounded_recording_duration`, and `recording_storage_duration` parameters to the response for [get single recording API](https://www.plivo.com/docs/voice/api/recording#retrieve-a-recording) and [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings)
- Added `recording_storage_duration` parameter as a filter option for [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings)

## [4.39.0](https://github.com/plivo/plivo-ruby/tree/v4.39.0) (2023-03-17)
**Adding new attribute - 'created_at' in List Profiles, Get Profile, List Brands, Get Brand, List Campaigns and Get Campaign APIs**
- dding new attribute - 'created_at' in List Profiles, Get Profile, List Brands, Get Brand, List Campaigns and Get Campaign APIs

## [4.38.1](https://github.com/plivo/plivo-ruby/tree/v4.38.1) (2023-03-06)
**Bug fix on create message**
- Bulk send message fix

## [4.38.0](https://github.com/plivo/plivo-ruby/tree/v4.38.0) (2023-03-03)
**Adding new attribute - 'is_domestic' in Get Message and List Message APIs**
- Add `is_domestic` to the response for the [list all messages API](https://www.plivo.com/docs/sms/api/message/list-all-messages/) and the [get message details API](https://www.plivo.com/docs/sms/api/message#retrieve-a-message)

## [4.37.1](https://github.com/plivo/plivo-ruby/tree/v4.37.1) (2023-02-23)
**Bug fix on Messaging object **
-
## [4.37.0](https://github.com/plivo/plivo-ruby/tree/v4.37.0) (2023-02-23)
**Feature - Enhance MDR filtering capabilities **
- Added new fields on MDR object response


## [4.36.0](https://github.com/plivo/plivo-ruby/tree/v4.36.0) (2022-01-25)
**Adding new attribute - 'requester_ip' in Get Message and List Mssage APIs**
Expand All @@ -8,6 +32,7 @@
**Adding new attribute - 'message_expiry' in Send Message API**
- Added new attribute - message_expiry in Send Message API


## [4.34.0](https://github.com/plivo/plivo-ruby/tree/v4.34.0) (2022-12-16)
**10DLC: Update Campaign API**
- Added Update Campaign API
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@ build:
docker-compose up --build --remove-orphans

test:
docker exec -it $$CONTAINER /bin/bash -c "bundle exec rake"
@[ "${CONTAINER}" ] && \
docker exec -it $$CONTAINER /bin/bash -c "bundle exec rake" || \
bundle exec rake

run:
@[ "${CONTAINER}" ] && \
(docker exec -it $$CONTAINER /bin/bash -c 'cd /usr/src/app/ruby-sdk-test/ && ruby test.rb') || \
(cd /usr/src/app/ruby-sdk-test/ && ruby test.rb)
11 changes: 8 additions & 3 deletions 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.36.0'
gem 'plivo', '>= 4.39.1'
```

And then execute:
Expand Down Expand Up @@ -191,5 +191,10 @@ export PLIVO_API_PROD_HOST=<plivoapi_public_endpoint>
5. The sdk directory will be mounted as a volume in the container. So any changes in the sdk code will also be reflected inside the container.
> To use the local code in the test file, import the sdk in test file using:
`require "/usr/src/app/lib/plivo.rb"`
6. To run unit tests, run `make test CONTAINER=<cont_id>` in host, where `<cont_id>` is the docker container id created in 2.
(The docker container should be running)
6. To run test code, run `make run CONTAINER=<cont_id>` in host.
7. To run unit tests, run `make test CONTAINER=<cont_id>` in host.
> `<cont_id>` is the docker container id created in 2.
(The docker container should be running)

> Test code and unit tests can also be run within the container using
`make run` and `make test` respectively. (`CONTAINER` argument should be omitted when running from the container)
20 changes: 17 additions & 3 deletions lib/plivo/resources/messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ def to_s
total_rate: @total_rate,
powerpack_id: @powerpack_id,
units: @units,
requester_ip: @requester_ip
tendlc_campaign_id: @tendlc_campaign_id,
destination_country_iso2: @destination_country_iso2,
tendlc_registration_status: @tendlc_registration_status,
requester_ip: @requester_ip,
is_domestic: @is_domestic
}.to_s
end
end
Expand Down Expand Up @@ -101,10 +105,17 @@ def create(src = nil, dst = nil, text = nil, options = nil, powerpack_uuid = nil

params = {
src: value[:src],
dst: value[:dst],
text: value[:text],
powerpack_uuid: value[:powerpack_uuid]
}
if (value[:dst].is_a?(Array))
value[:dst].each do |dst_num|
valid_param?(:dst_num, dst_num, [Integer, String, Symbol], true)
params[:dst] = value[:dst].join('<')
end
else
params[:dst] = value[:dst]
end

#Handling optional params in One HASH
if value.key?(:type) && valid_param?(:type, value[:type],String, true, %w[sms mms])
Expand Down Expand Up @@ -256,14 +267,17 @@ def create(src = nil, dst = nil, text = nil, options = nil, powerpack_uuid = nil
# @option options[List]: media_urls Minimum one media url should be present in Media urls list to send mms. Maximum allowd 10 media urls inside the list (e.g, media_urls : ['https//example.com/test.jpg', 'https://example.com/abcd.gif'])
# @option options[List]: media_ids Minimum one media ids should be present in Media ids list to send mms. Maximum allowd 10 media ids inside the list (e.g, media_ids : ['1fs211ba-355b-11ea-bbc9-02121c1190q7'])
# @option options [String] :powerpack_id Filter the results by powerpack id
# @option options [string]: tendlc_campaign_id - exact tendlc campaign id search
# @option options [string]:destination_country_iso2 - valid 2 character country_iso2
# @option options [string] : tendlc_registration_status - registered or unregistered enum allowed
def list(options = nil)
return perform_list if options.nil?
valid_param?(:options, options, Hash, true)

params = {}
params_expected = %i[
subaccount message_time message_time__gt message_time__gte
message_time__lt message_time__lte error_code powerpack_id
message_time__lt message_time__lte error_code powerpack_id tendlc_campaign_id tendlc_registration_status destination_country_iso2
]
params_expected.each do |param|
if options.key?(param) &&
Expand Down
4 changes: 4 additions & 0 deletions lib/plivo/resources/recordings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def to_s
api_id: @api_id,
call_uuid: @call_uuid,
conference_name: @conference_name,
cost: @cost,
days_of_storage: @days_of_storage,
recording_duration_ms: @recording_duration_ms,
recording_end_ms: @recording_end_ms,
recording_format: @recording_format,
Expand All @@ -27,6 +29,7 @@ def to_s
recording_type: @recording_type,
recording_url: @recording_url,
resource_uri: @resource_uri,
rounded_duration: @rounded_duration,
from_number: @from_number,
to_number: @to_number,
mpc_name: @mpc_name,
Expand Down Expand Up @@ -72,6 +75,7 @@ def list(options = nil)
add_time__lt add_time__lte
from_number to_number conference_uuid
conference_name mpc_name mpc_uuid
rounded_duration
]

params_expected.each do |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.36.0".freeze
VERSION = "4.39.1".freeze
end
20 changes: 11 additions & 9 deletions setup_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ if [ ! -f $testDir/test.rb ]; then
cd -
fi

echo -e "\n\nSDK setup complete!"
echo "To test your changes:"
echo -e "\t1. Add your test code in <path_to_cloned_sdk>/$testDir/test.rb on host (or /usr/src/app/$testDir/test.rb in the container)"
echo -e "\t\tNote: To use sdk in test file, import using $GREEN require \"/usr/src/app/lib/plivo.rb\"$NC"
echo -e "\t2. Run a terminal in the container using: $GREEN docker exec -it $HOSTNAME /bin/bash$NC"
echo -e "\t3. Navigate to the test directory: $GREEN cd /usr/src/app/$testDir$NC"
echo -e "\t4. Run your test file: $GREEN ruby test.rb$NC"
echo -e "\t5. For running unit tests, run on host: $GREEN make test CONTAINER=$HOSTNAME$NC"

echo -e "\n\nSDK setup complete! You can test changes either on host or inside the docker container:"
echo -e "\ta. To test your changes ON HOST:"
echo -e "\t\t1. Add your test code in <path_to_cloned_sdk>/$testDir/test.rb"
echo -e "\t\t2. Run your test file using: $GREEN make run CONTAINER=$HOSTNAME$NC"
echo -e "\t\t3. Run unit tests using: $GREEN make test CONTAINER=$HOSTNAME$NC"
echo
echo -e "\tb. To test your changes INSIDE CONTAINER:"
echo -e "\t\t1. Run a terminal in the container using: $GREEN docker exec -it $HOSTNAME /bin/bash$NC"
echo -e "\t\t2. Add your test code in /usr/src/app/$testDir/test.rb"
echo -e "\t\t3. Run your test file using: $GREEN make run$NC"
echo -e "\t\t4. Run unit tests using: $GREEN make test$NC"
# To keep the container running post setup
/bin/bash
3 changes: 2 additions & 1 deletion spec/mocks/brandGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"brand_id": "BPL3KN9",
"brand_type": "STARTER",
"ein_issuing_country": "US",
"registration_status": "COMPLETED"
"registration_status": "COMPLETED",
"created_at": "2023-01-16T06:22:35.195487Z"
}
}
27 changes: 18 additions & 9 deletions spec/mocks/brandListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"brand_id": "BPL3KN9",
"brand_type": "STARTER",
"ein_issuing_country": "US",
"registration_status": "COMPLETED"
"registration_status": "COMPLETED",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"address": {
Expand All @@ -39,7 +40,8 @@
"entity_type": "INDIVIDUAL",
"profile_uuid": "55515d72-2852-4016-9ed9-c64bd1c0c055",
"registration_status": "COMPLETED",
"vertical": "ENERGY"
"vertical": "ENERGY",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"address": {
Expand All @@ -64,7 +66,8 @@
"entity_type": "INDIVIDUAL",
"profile_uuid": "71a18795-77fa-4623-9735-44bbd08d86c4",
"registration_status": "COMPLETED",
"vertical": "ENTERTAINMENT"
"vertical": "ENTERTAINMENT",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"address": {
Expand All @@ -81,7 +84,8 @@
"ein_issuing_country": "IN",
"profile_uuid": "d3d85b2d-a4c2-4f7b-a66f-83002a5fd5e8",
"registration_status": "COMPLETED",
"vertical": "ENTERTAINMENT"
"vertical": "ENTERTAINMENT",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"address": {
Expand All @@ -100,7 +104,8 @@
"ein_issuing_country": "US",
"profile_uuid": "709a4b1c-bbde-40e6-be36-164b1dc8f718",
"registration_status": "COMPLETED",
"vertical": "ENTERTAINMENT"
"vertical": "ENTERTAINMENT",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"address": {
Expand All @@ -127,7 +132,8 @@
"entity_type": "PRIVATE",
"profile_uuid": "a28b5892-4d8b-4098-9fe7-6f786fb0be1f",
"registration_status": "COMPLETED",
"vertical": "ENTERTAINMENT"
"vertical": "ENTERTAINMENT",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"address": {
Expand All @@ -152,7 +158,8 @@
"entity_type": "GOVERNMENT",
"profile_uuid": "ca01734d-a86a-4ed4-aa5a-8723cbb595b3",
"registration_status": "COMPLETED",
"vertical": "ENERGY"
"vertical": "ENERGY",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"address": {
Expand All @@ -178,7 +185,8 @@
"profile_uuid": "c1a1c66a-2bc4-4150-a3f3-033ec41efc5d",
"registration_status": "COMPLETED",
"vertical": "ENTERTAINMENT",
"website": "hibye.com"
"website": "hibye.com",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"address": {
Expand Down Expand Up @@ -207,7 +215,8 @@
"registration_status": "COMPLETED",
"vertical": "PROFESSIONAL",
"vetting_score": 80,
"vetting_status": "ACTIVE"
"vetting_status": "ACTIVE",
"created_at": "2023-01-16T06:22:35.195487Z"
}
]
}
3 changes: 2 additions & 1 deletion spec/mocks/campaignGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"registration_status": "ACTIVE",
"reseller_id": "",
"sub_usecase": "2FA,MARKETING",
"usecase": "STARTER"
"usecase": "STARTER",
"created_at": "2023-01-16T06:22:35.195487Z"
}
}
30 changes: 20 additions & 10 deletions spec/mocks/campaignListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"registration_status": "ACTIVE",
"reseller_id": "RFWG6CB",
"sub_usecase": "CUSTOMER_CARE",
"usecase": "STARTER"
"usecase": "STARTER",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"brand_id": "BNOOLMO",
Expand All @@ -43,7 +44,8 @@
"registration_status": "FAILED",
"reseller_id": "",
"sub_usecase": "2FA,MARKETING",
"usecase": "STARTER"
"usecase": "STARTER",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"brand_id": "BWDWMAC",
Expand All @@ -65,7 +67,8 @@
"registration_status": "ACTIVE",
"reseller_id": "",
"sub_usecase": "2FA,MARKETING",
"usecase": "STARTER"
"usecase": "STARTER",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"brand_id": "BCKWPKX",
Expand All @@ -87,7 +90,8 @@
"registration_status": "PROCESSING",
"reseller_id": "",
"sub_usecase": "2FA,MARKETING",
"usecase": "MIXED"
"usecase": "MIXED",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"brand_id": "B2IYFNC",
Expand All @@ -109,7 +113,8 @@
"registration_status": "PROCESSING",
"reseller_id": "",
"sub_usecase": "2FA",
"usecase": "STARTER"
"usecase": "STARTER",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"brand_id": "BK98MJL",
Expand All @@ -129,7 +134,8 @@
}
},
"registration_status": "ACTIVE",
"reseller_id": ""
"reseller_id": "",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"brand_id": "B3WKVGC",
Expand All @@ -151,7 +157,8 @@
"registration_status": "PROCESSING",
"reseller_id": "RFWG6CB",
"sub_usecase": "CUSTOMER_CARE",
"usecase": "STARTER"
"usecase": "STARTER",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"brand_id": "BBYQU0Z",
Expand All @@ -172,7 +179,8 @@
},
"registration_status": "PROCESSING",
"reseller_id": "",
"usecase": "2FA"
"usecase": "2FA",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"brand_id": "BBYQU0Z",
Expand All @@ -193,7 +201,8 @@
},
"registration_status": "ACTIVE",
"reseller_id": "",
"usecase": "2FA"
"usecase": "2FA",
"created_at": "2023-01-16T06:22:35.195487Z"
},
{
"brand_id": "BBYQU0Z",
Expand All @@ -214,7 +223,8 @@
},
"registration_status": "ACTIVE",
"reseller_id": "",
"usecase": "2FA"
"usecase": "2FA",
"created_at": "2023-01-16T06:22:35.195487Z"
}
]
}
Loading