Skip to content

Commit

Permalink
SMS-6997: add brand_name and app_hash in create and list api (#285)
Browse files Browse the repository at this point in the history
* SMS-6997: add brand_name and app_hash in create and list api

* adding code length param for verify

---------

Co-authored-by: narayana-plivo <narayana@plivo.com>
  • Loading branch information
ashutoshkumar-plivo and narayana-plivo authored Sep 6, 2024
1 parent 3b0cacb commit 8a4e66d
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## [5.48.0](https://github.com/plivo/plivo-dotnet/tree/v5.48.0) (2024-08-12)
**Feature - Adding support for brand_name and app_hash in Create,Get and List Session**
- Added new request param `brand_name` and `app_hash` in create Session API
- Added support for `brand_name` and `app_hash` param in get and list Session response

## [5.47.4](https://github.com/plivo/plivo-dotnet/tree/v5.47.4) (2024-09-03)
**Feature - Adding new element for Audio Stream XML **
- Added `keepCallAlive` element in Audio Stream XML
Expand Down
4 changes: 2 additions & 2 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 5.47.4
PM> Install-Package Plivo -Version 5.48.0
```

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

```
> dotnet add package Plivo --version 5.47.4
> dotnet add package Plivo --version 5.48.0
```

## Getting started
Expand Down
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.47.4</ReleaseVersion>
<ReleaseVersion>5.48.0</ReleaseVersion>
<Version />
<Authors>Plivo SDKs Team</Authors>
<Owners>Plivo Inc.</Owners>
Expand Down
2 changes: 1 addition & 1 deletion src/Plivo/Plivo.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<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.47.4</version>
<version>5.48.0</version>
<title>Plivo</title>
<authors>Plivo SDKs Team</authors>
<owners>Plivo, Inc.</owners>
Expand Down
6 changes: 6 additions & 0 deletions src/Plivo/Resource/VerifySession/VerifySession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public class AttemptDetail {
public string Status { get; set; }
[JsonProperty("time")]
public string Time { get; set; }
[JsonProperty("brand_name")]
public string BrandName {get; set;}
[JsonProperty("app_hash")]
public string AppHash {get; set;}
[JsonProperty("code_length")]
public int CodeLength {get; set;}
}

[JsonObject(MemberSerialization.OptIn)]
Expand Down
32 changes: 28 additions & 4 deletions src/Plivo/Resource/VerifySession/VerifySessionInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ public VerifySessionInterface(HttpClient client) : base(client)
/// <param name="url">URL.</param>
/// <param name="method">Method.</param>
/// <param name="locale">Locale.</param>
/// <param name="brand_name">BrandName.</param>
/// <param name="app_hash">AppHash.</param>
/// <param name="code_length">CodeLength.</param>

public VerifySessionCreateResponse Create(
string recipient, string app_uuid = null, string channel = null, string url = null,
string method = null, string locale = null)
string method = null, string locale = null, string brand_name = null, string app_hash = null, int code_length = 0)
{
Dictionary<string, object> data = null;
var mandatoryParams = new List<string> { "recipient" };
Expand All @@ -49,7 +52,10 @@ public VerifySessionCreateResponse Create(
channel,
url,
method,
locale
locale,
brand_name,
app_hash,
code_length
});

return ExecuteWithExceptionUnwrap(() =>
Expand All @@ -70,10 +76,13 @@ public VerifySessionCreateResponse Create(
/// <param name="url">URL.</param>
/// <param name="method">Method.</param>
/// <param name="locale">Locale.</param>
/// <param name="brand_name">BrandName.</param>
/// <param name="app_hash">AppHash.</param>
/// <param name="code_length">CodeLength.</param>

public async Task<VerifySessionCreateResponse> CreateAsync(
string recipient, string app_uuid = null, string channel = null, string url = null,
string method = null, string locale = null)
string method = null, string locale = null, string brand_name = null, string app_hash = null, int code_length = 0)
{
Dictionary<string, object> data = null;
var mandatoryParams = new List<string> { "recipient" };
Expand All @@ -86,7 +95,10 @@ public async Task<VerifySessionCreateResponse> CreateAsync(
channel,
url,
method,
locale
locale,
brand_name,
app_hash,
code_length
});

var result = await Client.Update<VerifySessionCreateResponse>(Uri, data);
Expand Down Expand Up @@ -145,6 +157,8 @@ public async Task<VerifySession> GetAsync(string messageUuid)
/// <param name="session_time__lt">SessionTimeLT.</param>
/// <param name="session_time__lte">SessionTimeLTE.</param>
/// <param name="session_time">SessionTime.</param>
/// <param name="brand_name">BrandName.</param>
/// <param name="app_hash">AppHash.</param>
public VerifySessionListResponse<VerifySession> List(
uint? limit = null,
uint? offset = null,
Expand All @@ -154,6 +168,8 @@ public VerifySessionListResponse<VerifySession> List(
string country = null,
string alias = null,
string subaccount = null,
string brand_name = null,
string app_hash = null,
DateTime? session_time__gt = null,
DateTime? session_time__gte = null,
DateTime? session_time__lt = null,
Expand All @@ -178,6 +194,8 @@ public VerifySessionListResponse<VerifySession> List(
country,
alias,
subaccount,
brand_name,
app_hash,
_session_time__gt,
_session_time__gte,
_session_time__lt,
Expand Down Expand Up @@ -211,6 +229,8 @@ public VerifySessionListResponse<VerifySession> List(
/// <param name="session_time__lt">SessionTimeLT.</param>
/// <param name="session_time__lte">SessionTimeLTE.</param>
/// <param name="session_time">SessionTime.</param>
/// <param name="brand_name">BrandName.</param>
/// <param name="app_hash">AppHash.</param>
public async Task<VerifySessionListResponse<VerifySession>> ListAsync(
uint? limit = null,
uint? offset = null,
Expand All @@ -220,6 +240,8 @@ public async Task<VerifySessionListResponse<VerifySession>> ListAsync(
string country = null,
string alias = null,
string subaccount = null,
string brand_name = null,
string app_hash = null,
DateTime? session_time__gt = null,
DateTime? session_time__gte = null,
DateTime? session_time__lt = null,
Expand All @@ -244,6 +266,8 @@ public async Task<VerifySessionListResponse<VerifySession>> ListAsync(
country,
alias,
subaccount,
brand_name,
app_hash,
_session_time__gt,
_session_time__gte,
_session_time__lt,
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.47.4";
public const string SdkVersion = "5.48.0";
/// <summary>
/// Plivo API version
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.47.4",
"version": "5.48.0",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
Expand Down

0 comments on commit 8a4e66d

Please sign in to comment.