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 #241

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Change Log
<<<<<<< HEAD
# Change Log]
## [v5.24.1](https://github.com/plivo/plivo-dotnet/tree/v5.23.1) (2023-04-04)
- Added `MonthlyRecordingStorageAmount`, `RecordingStorageRate`, `RoundedRecordingDuration`, and `RecordingStorageDuration` 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 `RecordingStorageDuration` parameter as a filter option for [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings)

## [v5.24.0](https://github.com/plivo/plivo-dotnet/tree/v5.23.0) (2023-17-03)
- Added New Param `CreatedAt` to the response for the [list all profiles API](https://www.plivo.com/docs/sms/api/10dlc/profile#retrieve-all-profiles) and the [get profile API](https://www.plivo.com/docs/sms/api/10dlc/profile#retrieve-a-specific-profile) and the [list all brands API](https://www.plivo.com/docs/sms/api/10dlc/brand#retrieve-all-brands) and the [get brand API](https://www.plivo.com/docs/sms/api/10dlc/brand#retrieve-a-specific-brand) and the [list all campaigns API](https://www.plivo.com/docs/sms/api/10dlc/campaign#retrieve-all-campaigns) and the [get campaign API](https://www.plivo.com/docs/sms/api/10dlc/campaign#retrieve-a-specific-campaign)

## [v5.23.0](https://github.com/plivo/plivo-dotnet/tree/v5.23.0) (2023-03-03)
- Added new param `IsDomestic` 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)

## [v5.22.0](https://github.com/plivo/plivo-dotnet/tree/v5.22.0) (2023-02-23)
- Enhance MDR filtering capabilities

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM ubuntu:latest

WORKDIR /usr/src/app

RUN apt-get update && apt-get install -y wget git vim
RUN apt-get update && apt-get install -y wget git vim make
RUN apt-get install -y apt-transport-https

# Install dotnet sdk and runtime: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
.PHONY: build
.PHONY: build run

build:
docker-compose up --build --remove-orphans
docker-compose up --build --remove-orphans

run:
@[ "${CONTAINER}" ] && \
(docker exec -it $$CONTAINER /bin/bash -c 'cd /usr/src/app/dotnet-sdk-test/ && dotnet run Program.cs') || \
(cd /usr/src/app/dotnet-sdk-test/ && dotnet run Program.cs)
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ You can install this SDK either by referencing the .dll file or using NuGet.
Use the following line to install the latest SDK using the NuGet CLI.

```
PM> Install-Package Plivo -Version 4.2.5
PM> Install-Package Plivo -Version 5.23.1
```

You can also use the .NET CLI to install this package as follows

```
> dotnet add package Plivo --version 4.2.5
> dotnet add package Plivo --version 5.23.1
```

## Getting started
Expand Down Expand Up @@ -141,4 +141,10 @@ export PLIVO_API_PROD_HOST=<plivoapi_public_endpoint>
(or `/usr/src/app/dotnet-sdk-test/Program.cs` in container)
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. However, when any change is made, the dependencies for the test program need to be re-installed. To do that:
* Either restart the docker container
* Or Run the `setup_sdk.sh` script
* Or Run the `setup_sdk.sh` script
6. To run test code, run `make run CONTAINER=<cont_id>` in host.
> `<cont_id>` is the docker container id created in 2.
(The docker container should be running)

> Test code can also be run within the container using
`make run`. (`CONTAINER` argument should be omitted when running from the container)
18 changes: 12 additions & 6 deletions setup_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ find /usr/src/app/src/Plivo/Client -type f -exec sed -i "s/$PLIVO_API_PROD_HOST/
if [ ! -d $testDir ]; then
echo "Creating test dir..."
mkdir -p $testDir
fi

if [[ $( grep "Plivo.NetCore.Test" Plivo.sln ) ]]; then
# Fix for library issue: See Dotnet section of https://plivo-team.atlassian.net/wiki/spaces/SMSTEAM/pages/3581313044/Local+Setup+for+SDKs
sed -i '/Nerdbank.GitVersioning/ {
n;
Expand All @@ -38,12 +41,15 @@ if [ ! -f $testDir/*.csproj ]; then
dotnet restore
fi

echo -e "\n\nSDK setup complete!"
echo "To test your changes:"
echo -e "\t1. Add your test code to <path_to_cloned_sdk>/$testDir/Program.cs on host (or /usr/src/app/$testDir/Program.cs in the container)"
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 dotnet run Program.cs$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 to <path_to_cloned_sdk>/$testDir/Program.cs"
echo -e "\t\t2. Run your test file using: $GREEN make run 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/Program.cs"
echo -e "\t\t3. Run your test file using: $GREEN make run$NC"

# To keep the container running post setup
/bin/bash
2 changes: 1 addition & 1 deletion src/Plivo/Plivo.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard1.3</TargetFrameworks>
<ReleaseVersion>5.22.0</ReleaseVersion>
<ReleaseVersion>5.24.1</ReleaseVersion>
<Version />
<Authors>Plivo SDKs Team</Authors>
<Owners>Plivo Inc.</Owners>
Expand Down
5 changes: 4 additions & 1 deletion src/Plivo/Plivo.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
<summary>A .NET SDK to make voice calls and send SMS using Plivo and to generate Plivo XML</summary>
<description>A .NET SDK to make voice calls and send SMS using Plivo and to generate Plivo XML</description>
<id>Plivo</id>
<version>5.21.0</version>
<version>5.24.1</version>
<title>Plivo</title>
<authors>Plivo SDKs Team</authors>
<owners>Plivo, Inc.</owners>
<licenseUrl>https://github.com/plivo/plivo-dotnet/blob/master/LICENSE.txt</licenseUrl>
<projectUrl>http://github.com/plivo/plivo-dotnet</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<releaseNotes>
* 5.24.1 Added new Params 'MonthlyRecordingStorageAmount', 'RecordingStorageRate', 'RecordingStorageDuration' and 'RoundedRecordingDuration' to List Recordings and Get Recording APIs
* 5.24.0 Added New Param 'CreatedAt' to List Profiles, Get Profile, List Brands, Get Brand, List Campaigns, Get Campaign APIs
* 5.23.0 Added New Param 'IsDomestic' to List Message and Get Message APIs
* 5.22.0 Added New Params to List Message and Get Message APIs
* 5.21.0 Added New Param 'RequesterIp' to List Message and Get Message APIs
* 5.19.0 Added Update campaign endpoints
Expand Down
6 changes: 6 additions & 0 deletions src/Plivo/Resource/Brand/Brand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public class BrandResponse

[JsonProperty("address")]
public Address Address { get; set; }

[JsonProperty("created_at")]
public string CreatedAt { get; set; }

}

Expand Down Expand Up @@ -159,6 +162,9 @@ public class ListBrands: Resource
[JsonProperty("vetting_status")]
public string VettingStatus { get; set; }

[JsonProperty("created_at")]
public string CreatedAt { get; set; }

[JsonProperty("address")]
public Address Address { get; set; }

Expand Down
6 changes: 5 additions & 1 deletion src/Plivo/Resource/Campaign/Campaign.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ public class CampaignResponse
[JsonProperty("help_keywords")]
public string HelpKeywords { get; set; }


[JsonProperty("created_at")]
public string CreatedAt { get; set; }
}

[JsonObject(MemberSerialization.OptIn)]
Expand Down Expand Up @@ -203,6 +204,9 @@ public class ListCampaigns: Resource
[JsonProperty("help_keywords")]
public string HelpKeywords { get; set; }

[JsonProperty("created_at")]
public string CreatedAt { get; set; }

public override string ToString()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
Expand Down
9 changes: 8 additions & 1 deletion src/Plivo/Resource/Message/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ public class Message : Resource
/// <value>The requester ip.</value>
public string RequesterIp { get; set; }

/// <summary>
/// Gets or sets the is domestic.
/// </summary>
/// <value>The is domestic.</value>
public bool? IsDomestic { get; set; }

public override string ToString()
{
return "\n" +
Expand All @@ -131,7 +137,8 @@ public override string ToString()
"DestinationCountryIso2: " + DestinationCountryIso2 + "\n" +
"TendlcCampaignId: " + TendlcCampaignId + "\n" +
"TendlcRegistrationStatus: "+ TendlcRegistrationStatus + "\n" +
"RequesterIP: " + RequesterIp + "\n";
"RequesterIP: " + RequesterIp + "\n" +
"IsDomestic: " + IsDomestic + "\n";
}
#region ListMedia
/// <summary>
Expand Down
6 changes: 6 additions & 0 deletions src/Plivo/Resource/Profile/Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ public class Profile
[JsonProperty("plivo_subaccount")]
public string PlivoSubaccount { get; set; }

[JsonProperty("created_at")]
public string CreatedAt { get; set; }

}

[JsonObject(MemberSerialization.OptIn)]
Expand Down Expand Up @@ -175,6 +178,9 @@ public class ListProfiles: Resource
[JsonProperty("profile_uuid")]
public string ProfileUuid { get; set; }

[JsonProperty("created_at")]
public string CreatedAt { get; set; }

[JsonProperty("plivo_subaccount")]
public string PlivoSubaccount { get; set; }

Expand Down
6 changes: 6 additions & 0 deletions src/Plivo/Resource/Recording/Recording.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public class Recording : Resource
public string AddTime { get; set; }
public string CallUuid { get; set; }
public string ConferenceName { get; set; }
public string Cost { get; set; }
public string DaysOfStorage { get; set; }
public string RecordingDurationMs { get; set; }
public string RecordingEndMs { get; set; }
public string RecordingFormat { get; set; }
Expand All @@ -16,6 +18,7 @@ public class Recording : Resource
public string RecordingType { get; set; }
public string RecordingUrl { get; set; }
public string ResourceUri { get; set; }
public string RoundedDuration { get; set; }
public string FromNumber { get; set; }
public string ToNumber { get; set; }

Expand All @@ -25,6 +28,8 @@ public override string ToString()
"AddTime: " + AddTime + "\n" +
"CallUuid: " + CallUuid + "\n" +
"ConferenceName: " + ConferenceName + "\n" +
"Cost: " + Cost + "\n" +
"DaysOfStorage: " + DaysOfStorage + "\n" +
"RecordingDurationMs: " + RecordingDurationMs + "\n" +
"RecordingEndMs: " + RecordingEndMs + "\n" +
"RecordingFormat: " + RecordingFormat + "\n" +
Expand All @@ -33,6 +38,7 @@ public override string ToString()
"RecordingType: " + RecordingType + "\n" +
"RecordingUrl: " + RecordingUrl + "\n" +
"ResourceUri: " + ResourceUri + "\n" +
"RoundedDuration: " + RoundedDuration + "\n" +
"FromNumber: " + FromNumber + "\n" +
"ToNumber: " + ToNumber + "\n";

Expand Down
8 changes: 7 additions & 1 deletion src/Plivo/Resource/Recording/RecordingInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ public async Task<AsyncResponse> GetAsync(string recordingId, string callbackUrl
/// <param name="mpcName">Mpc Name.</param>
/// <param name="conferenceUuid">Conference Uuid.</param>
/// <param name="mpcUuid">mpc Uuid.</param>
/// <param name="roundedDuration">Rounded duration.</param>
public ListResponse<Recording> List(
string fromNumber = null, string toNumber = null,
string conferenceName = null, string mpcName = null,
string conferenceUuid = null, string mpcUuid = null,
string subaccount = null, string callUuid = null,
string subaccount = null, string callUuid = null,
uint? roundedDuration = null,
DateTime? addTime = null, DateTime? addTime_Gt = null,
DateTime? addTime_Gte = null, DateTime? addTime_Lt = null,
DateTime? addTime_Lte = null, uint? limit = null,
Expand All @@ -119,6 +121,7 @@ public ListResponse<Recording> List(
mpcUuid,
subaccount,
callUuid,
roundedDuration,
_addTime,
_addTime_Gt,
_addTime_Gte,
Expand Down Expand Up @@ -161,11 +164,13 @@ public ListResponse<Recording> List(
/// <param name="mpcName">Mpc Name.</param>
/// <param name="conferenceUuid">Conference Uuid.</param>
/// <param name="mpcUuid">mpc Uuid.</param>
/// <param name="roundedDuration">Rounded duration.</param>
public async Task<AsyncResponse> ListAsync(
string fromNumber = null, string toNumber = null,
string conferenceName = null, string mpcName = null,
string conferenceUuid = null, string mpcUuid = null,
string subaccount = null, string callUuid = null,
uint? roundedDuration = null,
DateTime? addTime = null, DateTime? addTime_Gt = null,
DateTime? addTime_Gte = null, DateTime? addTime_Lt = null,
DateTime? addTime_Lte = null, uint? limit = null,
Expand All @@ -191,6 +196,7 @@ public async Task<AsyncResponse> ListAsync(
mpcUuid,
subaccount,
callUuid,
roundedDuration,
_addTime,
_addTime_Gt,
_addTime_Gte,
Expand Down
2 changes: 1 addition & 1 deletion src/Plivo/Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Version
/// <summary>
/// DotNet SDK version
/// </summary>
public const string SdkVersion = "5.22.0";
public const string SdkVersion = "5.24.1";
/// <summary>
/// Plivo API version
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
"recording_url": "http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-11e4-a664-0026b945b52x.mp3",
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-11e4-a664-0026b945b52x/",
"from_number": "+919999323467",
"to_number": "+919891865130"
"to_number": "+919891865130",
"cost": "0.0004",
"rounded_duration": "120",
"days_of_storage": "209"
}
15 changes: 12 additions & 3 deletions tests_netcore/Plivo.NetCore.Test/Mocks/recordingListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
"recording_url": "http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-1124-a664-0026b945b522.mp3",
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-1124-a664-0026b945b522/",
"from_number": "+919999323467",
"to_number": "+919891865130"
"to_number": "+919891865130",
"cost": "0.0004",
"rounded_duration": "120",
"days_of_storage": "209"
},
{
"add_time": "2014-08-05 16:05:21.993853+05:30",
Expand All @@ -36,7 +39,10 @@
"recording_url": "http://s3.amazonaws.com/recordings_2013/fc2716b0-1c8b-11e4-bwad-842b2b17453e.mp3",
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/fc2716b0-1c8b-11e4-bwad-842b2b17453e/",
"from_number": "+919999323467",
"to_number": "+919891865130"
"to_number": "+919891865130",
"cost": "0.0004",
"rounded_duration": "120",
"days_of_storage": "209"
},
{
"add_time": "2014-08-05 15:51:56.582492+05:30",
Expand All @@ -51,7 +57,10 @@
"recording_url": "http://s3.amazonaws.com/recordings_2013/3e701c9e-1c8a-11e4-bwad-842b2b17453e.mp3",
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/3e701c9e-1c8a-11e4-bwad-842b2b17453e/",
"from_number": "+919999323467",
"to_number": "+919891865130"
"to_number": "+919891865130",
"cost": "0.0004",
"rounded_duration": "120",
"days_of_storage": "209"
}
]
}
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.22.0",
"version": "5.24.0",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
Expand Down