Skip to content

Commit

Permalink
conflict_resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
ajay-plivo committed Jun 1, 2023
2 parents edac912 + 7cf4e76 commit 9efade6
Show file tree
Hide file tree
Showing 29 changed files with 178 additions and 58 deletions.
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
# Change Log
## [4.38.2](https://github.com/plivo/plivo-ruby/tree/v4.38.2) (2023-03-16)

## [4.44.0](https://github.com/plivo/plivo-ruby/tree/v4.38.2) (2023-03-16)
**Feature : Added new param in getCallDetail api**
- From now on we can see CNAM(Caller_id name) details at CDR level.

## [4.43.0](https://github.com/plivo/plivo-ruby/tree/v4.43.0) (2023-05-29)

This comment has been minimized.

Copy link
@n00dle

n00dle Jun 6, 2023

Why are the release dates out of order for ascending gem versions?

Also, 4.45.0's date says 5/2 but should be 6/2.

**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.42.0](https://github.com/plivo/plivo-ruby/tree/v4.42.0) (2023-05-04)
**Adding new attribute - 'renewalDate' in Get Number and List Number APIs**
- Add New Param `renewalDate` to the response of the [list all numbers API], [list single number API]
- Add 3 new filters to AccountPhoneNumber - list all my numbers API:`renewal_date`, `renewal_date__gt`, `renewal_date__gte`,`renewal_date__lt` and `renewal_date__lte` (https://www.plivo.com/docs/numbers/api/account-phone-number#list-all-my-numbers)

## [4.41.0](https://github.com/plivo/plivo-ruby/tree/v4.41.0) (2023-04-25)
**Adding new attribute - 'replaced_sender' in Get Message and List Message APIs**
- Add `replaced_sender` 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.40.0](https://github.com/plivo/plivo-ruby/tree/v4.37.0) (2023-04-11)
**Feature - Added New Param 'source_ip' in GetCall and ListCalls**
- Add `source_ip` to the response for the [retrieve a call details API](https://www.plivo.com/docs/voice/api/call#retrieve-a-call) and the [retreive all call details API](https://www.plivo.com/docs/voice/api/call#retrieve-all-calls)

## [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
Expand All @@ -18,6 +41,9 @@
**Feature - Enhance MDR filtering capabilities **
- Added new fields on MDR object response

## [4.37.0](https://github.com/plivo/plivo-ruby/tree/v4.37.0) (2023-02-06)
**Feature - Added New Param 'source_ip' in GetCall and ListCalls**
- Add `source_ip` to the response for the [retrieve a call details API](https://www.plivo.com/docs/voice/api/call#retrieve-a-call) and the [retreive all call details API](https://www.plivo.com/docs/voice/api/call#retrieve-all-calls)

## [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 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.38.2'
gem 'plivo', '>= 4.44.0'
```

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)
1 change: 1 addition & 0 deletions lib/plivo/resources/calls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ def to_s
caller_name: @caller_name,
stir_verification: @stir_verification,
stir_attestation: @stir_attestation,
source_ip: @source_ip,
cnam_lookup: @cnam_lookup
}
call_details = call_details.select {|k, v| !v.nil? }
Expand Down
3 changes: 2 additions & 1 deletion lib/plivo/resources/messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def to_s
destination_country_iso2: @destination_country_iso2,
tendlc_registration_status: @tendlc_registration_status,
requester_ip: @requester_ip,
is_domestic: @is_domestic
is_domestic: @is_domestic,
replaced_sender: @replaced_sender
}.to_s
end
end
Expand Down
10 changes: 8 additions & 2 deletions lib/plivo/resources/numbers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ def to_s
voice_rate: @voice_rate,
tendlc_campaign_id: @tendlc_campaign_id,
tendlc_registration_status: @tendlc_registration_status,
toll_free_sms_verification: @toll_free_sms_verification
toll_free_sms_verification: @toll_free_sms_verification,
renewal_date: @renewal_date
}.to_s
end
end
Expand Down Expand Up @@ -220,14 +221,19 @@ def get(number)
# - 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.
# @option options [String] :renewal_date Returns phone numbers that will be renewed on the specified date. Format: YYYY-MM-DD
# @option options [String] :renewal_date__lt Returns phone numbers that will be renewed before the specified date. Format: YYYY-MM-DD
# @option options [String] :renewal_date__lte Returns phone numbers that will be renewed on or before the specified date. Format: YYYY-MM-DD
# @option options [String] :renewal_date__gt Returns phone numbers that will be renewed after the specified date. Format: YYYY-MM-DD
# @option options [String] :renewal_date__gte Returns phone numbers that will be renewed on or after the specified date. Format: YYYY-MM-DD
def list(options = nil)
return perform_list if options.nil?

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

params = {}

%i[number_startswith subaccount alias tendlc_campaign_id tendlc_registration_status toll_free_sms_verification].each do |param|
%i[number_startswith subaccount alias tendlc_campaign_id tendlc_registration_status toll_free_sms_verification renewal_date renewal_date__lt renewal_date__lte renewal_date__gt renewal_date__gte].each do |param|
if options.key?(param) &&
valid_param?(param, options[param], [String, Symbol], true)
params[param] = options[param]
Expand Down
16 changes: 15 additions & 1 deletion 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,
monthly_recording_storage_amount: @monthly_recording_storage_amount,
recording_storage_duration: @recording_storage_duration,
recording_duration_ms: @recording_duration_ms,
recording_end_ms: @recording_end_ms,
recording_format: @recording_format,
Expand All @@ -27,6 +29,8 @@ def to_s
recording_type: @recording_type,
recording_url: @recording_url,
resource_uri: @resource_uri,
rounded_recording_duration: @rounded_recording_duration,
recording_storage_rate: @recording_storage_rate,
from_number: @from_number,
to_number: @to_number,
mpc_name: @mpc_name,
Expand Down Expand Up @@ -60,6 +64,13 @@ def initialize(client, resource_list_json = nil)
# - add_time\__lt: lt stands for lesser than. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. Eg:- To get all recordings that started before 2012-03-21 11:47, use add_time\__lt=2012-03-21 11:47
# - add_time\__gte: lte stands for lesser than or equal. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. Eg:- To get all recordings that started before or exactly at 2012-03-21 11:47[:30], use add_time\__lte=2012-03-21 11:47[:30]
# - Note: The above filters can be combined to get recordings that started in a particular time range.
# @option options [Int] :recording_storage_duration - Used to filter out recordings according to the number of days they have been stored in the DB.The recording_storage_duration filter can be used in the following five forms:
# - recording_storage_duration: Takes an integer input and returns the recordings which are as old as that value.
# - recording_storage_duration\__gt: gt stands for greater than. The format expected is an integer value. Eg:- To get all recordings that are older than 100 days, use recording_storage_duration\__gt=100
# - recording_storage_duration\__gte: gte stands for greater than or equal. The format expected is an integer value. Eg:- To get all recordings that are older than or equal to 100 days old, use recording_storage_duration\__gte=100
# - recording_storage_duration\__lt: lt stands for lesser than. The format expected is an integer value. Eg:- To get all recordings that are newer than 100 days, use recording_storage_duration\__lt=100
# - recording_storage_duration\__lte: lte stands for lesser than or equal. The format expected is an integer value. Eg:- To get all recordings that are newer than or equal to 100 days old, use recording_storage_duration\__lte=100
# - Note: The above filters can be combined to get recordings that started in a particular time range.
# @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.
def list(options = nil)
Expand All @@ -72,10 +83,13 @@ def list(options = nil)
add_time__lt add_time__lte
from_number to_number conference_uuid
conference_name mpc_name mpc_uuid
recording_storage_duration
recording_storage_duration__gt recording_storage_duration__gte
recording_storage_duration__lt recording_storage_duration__lte
]

params_expected.each do |param|
if options.key?(param) && valid_param?(param, options[param], [String, Symbol], true)
if options.key?(param) && valid_param?(param, options[param], [String, Symbol, Integer], true)
params[param] = options[param]
end
end
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.38.2".freeze
VERSION = "4.44.0".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"
}
]
}
1 change: 1 addition & 0 deletions spec/mocks/callGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"total_rate": "0.03570",
"stir_verification": "Verified",
"stir_attestation": "A",
"source_ip": "",
"cnam_lookup": "disabled"
}
2 changes: 2 additions & 0 deletions spec/mocks/callListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"total_rate": "0.00850",
"stir_verification": "Not Verified",
"stir_attestation": "",
"source_ip": "",
"cnam_lookup": "disabled"
},
{
Expand All @@ -46,6 +47,7 @@
"total_rate": "0.00850",
"stir_verification": "Not Applicable",
"stir_attestation": "",
"source_ip": "",
"cnam_lookup": "disabled"
}
]
Expand Down
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"
}
}
Loading

0 comments on commit 9efade6

Please sign in to comment.