Skip to content

Commit

Permalink
Merge pull request #261 from plivo/SMS-6099
Browse files Browse the repository at this point in the history
SMS-6099: Added meta data for List Profile, Brand and Campaign
  • Loading branch information
renoldthomas-plivo authored Oct 18, 2023
2 parents a981393 + 7a5e457 commit c19069b
Show file tree
Hide file tree
Showing 12 changed files with 206 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [5.35.0](https://github.com/plivo/plivo-dotnet/tree/v5.35.0) (2023-10-17)
**Feature - Fixes for Campaign services list API meta data**
- Fixed Meta data response for campaign, brand and profile list

## [5.34.0](https://github.com/plivo/plivo-dotnet/tree/v5.34.0) (2023-10-13)
**Feature - WhatsApp message support**
- Added new params `template`, `template_json_string` and new message_type `whatsapp` to [send message API](https://www.plivo.com/docs/sms/api/message#send-a-message)
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.34.0
PM> Install-Package Plivo -Version 5.35.0
```

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

```
> dotnet add package Plivo --version 5.34.0
> dotnet add package Plivo --version 5.35.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.34.0</ReleaseVersion>
<ReleaseVersion>5.35.0</ReleaseVersion>
<Version />
<Authors>Plivo SDKs Team</Authors>
<Owners>Plivo Inc.</Owners>
Expand Down
3 changes: 2 additions & 1 deletion src/Plivo/Plivo.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
<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.34.0</version>
<version>5.35.0</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.35.0 Fixes for Campaign services list API meta data.
* 5.34.0 Added new params `template`, `template_json_string` and message_type `whatsapp`in send message API. Added new `message_state` (`read`), `message_type` (`whatsapp`), `conversation_id`, `conversation_origin`, `conversation_expiration_timestamp` in List Message and Get Message APIs.
* 5.33.0 Added New Params `DestinationNetwork`, `CarrierFeesRate`, `CarrierFees`.
* 5.32.0 Added New Params `DLTEntityID`, `DLTTemplateID`, `DLTTemplateCategory`.
Expand Down
9 changes: 8 additions & 1 deletion src/Plivo/Resource/Brand/BrandListResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ namespace Plivo.Resource
[JsonObject]
public class BrandListResponse<T> : BaseResponse, IEnumerable<T>
{
/// <summary>
/// Gets or sets the meta.
/// </summary>
/// <value>The meta.</value>
public BrandMeta Meta { get; set; }
/// <summary>
/// Gets or sets the objects.
/// </summary>
Expand All @@ -29,8 +34,9 @@ public BrandListResponse()
/// </summary>
/// <param name="meta">Meta.</param>
/// <param name="brands">brands.</param>
public BrandListResponse( List<T> brands)
public BrandListResponse(BrandMeta meta, List<T> brands)
{
Meta = meta ?? throw new ArgumentNullException(nameof(meta));
Brands = brands ?? throw new ArgumentNullException(nameof(brands));
}

Expand Down Expand Up @@ -59,6 +65,7 @@ public IEnumerator<T> GetEnumerator()
public override string ToString()
{
return "Api Id: " + ApiId + "\n" +
"[Meta]\n" + Meta +
"StatusCode: " + StatusCode +
"[Brands]\n" + string.Join("\n", Brands);

Expand Down
59 changes: 59 additions & 0 deletions src/Plivo/Resource/Brand/BrandMeta.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using System.Threading;
using Newtonsoft.Json;

namespace Plivo.Resource
{
/// <summary>
/// Brand Meta.
/// </summary>
public class BrandMeta
{
/// <summary>
/// Gets or sets the limit.
/// </summary>
/// <value>The limit.</value>
public uint Limit { get; set; }

/// <summary>
/// Gets or sets the next.
/// </summary>
/// <value>The next.</value>
[JsonProperty("next")]
public string Next { get; set; }

/// <summary>
/// Gets or sets the offset.
/// </summary>
/// <value>The offset.</value>
[JsonProperty("offset")]
public uint Offset { get; set; }

/// <summary>
/// Gets or sets the previous.
/// </summary>
/// <value>The previous.</value>
[JsonProperty("previous")]
public string Previous { get; set; }

/// <summary>
/// Gets or sets the total_count.
/// </summary>
/// <value>The total_count.</value>
[JsonProperty("total_count")]
public uint TotalCount { get; set; }

/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:plivo.Resource.Meta"/>.
/// </summary>
/// <returns>A <see cref="T:System.String"/> that represents the current <see cref="T:plivo.Resource.Meta"/>.</returns>
public override string ToString()
{
return
"Limit: " + Limit + "\n" +
"Next: " + Next + "\n" +
"Offset: " + Offset + "\n" +
"Previous: " + Previous + "\n" +
"TotalCount: " + TotalCount + "\n";
}
}
}
10 changes: 9 additions & 1 deletion src/Plivo/Resource/Campaign/CampaignListResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ namespace Plivo.Resource
[JsonObject]
public class CampaignListResponse<T> : BaseResponse, IEnumerable<T>
{

/// <summary>
/// Gets or sets the meta.
/// </summary>
/// <value>The meta.</value>
public CampaignMeta Meta { get; set; }
/// <summary>
/// Gets or sets the objects.
/// </summary>
Expand All @@ -29,8 +35,9 @@ public CampaignListResponse()
/// </summary>
/// <param name="meta">Meta.</param>
/// <param name="Campaigns">Campaigns.</param>
public CampaignListResponse( List<T> campaigns)
public CampaignListResponse(CampaignMeta meta, List<T> campaigns)
{
Meta = meta ?? throw new ArgumentNullException(nameof(meta));
Campaigns = campaigns ?? throw new ArgumentNullException(nameof(campaigns));
}

Expand Down Expand Up @@ -59,6 +66,7 @@ public IEnumerator<T> GetEnumerator()
public override string ToString()
{
return "Api Id: " + ApiId + "\n" +
"[Meta]\n" + Meta +
"StatusCode: " + StatusCode +
"[Campaigns]\n" + string.Join("\n", Campaigns);

Expand Down
60 changes: 60 additions & 0 deletions src/Plivo/Resource/Campaign/CampaignMeta.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using System.Threading;
using Newtonsoft.Json;

namespace Plivo.Resource
{
/// <summary>
/// Campaign Meta.
/// </summary>
public class CampaignMeta
{
/// <summary>
/// Gets or sets the limit.
/// </summary>
/// <value>The limit.</value>
public uint Limit { get; set; }

/// <summary>
/// Gets or sets the next.
/// </summary>
/// <value>The next.</value>
[JsonProperty("next")]
public string Next { get; set; }

/// <summary>
/// Gets or sets the offset.
/// </summary>
/// <value>The offset.</value>
[JsonProperty("offset")]
public uint Offset { get; set; }

/// <summary>
/// Gets or sets the previous.
/// </summary>
/// <value>The previous.</value>
[JsonProperty("previous")]
public string Previous { get; set; }


/// <summary>
/// Gets or sets the total_count.
/// </summary>
/// <value>The total_count.</value>
[JsonProperty("total_count")]
public uint TotalCount { get; set; }

/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:plivo.Resource.Meta"/>.
/// </summary>
/// <returns>A <see cref="T:System.String"/> that represents the current <see cref="T:plivo.Resource.Meta"/>.</returns>
public override string ToString()
{
return
"Limit: " + Limit + "\n" +
"Next: " + Next + "\n" +
"Offset: " + Offset + "\n" +
"Previous: " + Previous + "\n" +
"TotalCount: " + TotalCount + "\n";
}
}
}
9 changes: 8 additions & 1 deletion src/Plivo/Resource/Profile/ProfileListResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ namespace Plivo.Resource
[JsonObject]
public class ProfileListResponse<T> : BaseResponse, IEnumerable<T>
{
/// <summary>
/// Gets or sets the meta.
/// </summary>
/// <value>The meta.</value>
public ProfileMeta Meta { get; set; }
/// <summary>
/// Gets or sets the objects.
/// </summary>
Expand All @@ -29,8 +34,9 @@ public ProfileListResponse()
/// </summary>
/// <param name="meta">Meta.</param>
/// <param name="profiles">profiles.</param>
public ProfileListResponse( List<T> profiles)
public ProfileListResponse(ProfileMeta meta, List<T> profiles)
{
Meta = meta ?? throw new ArgumentNullException(nameof(meta));
Profiles = profiles ?? throw new ArgumentNullException(nameof(profiles));
}

Expand Down Expand Up @@ -59,6 +65,7 @@ public IEnumerator<T> GetEnumerator()
public override string ToString()
{
return "Api Id: " + ApiId + "\n" +
"[Meta]\n" + Meta +
"StatusCode: " + StatusCode +
"[profiles]\n" + string.Join("\n", Profiles);

Expand Down
51 changes: 51 additions & 0 deletions src/Plivo/Resource/Profile/ProfileMeta.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System.Threading;
using Newtonsoft.Json;

namespace Plivo.Resource
{
/// <summary>
/// Profile Meta.
/// </summary>
public class ProfileMeta
{
/// <summary>
/// Gets or sets the limit.
/// </summary>
/// <value>The limit.</value>
public uint Limit { get; set; }

/// <summary>
/// Gets or sets the next.
/// </summary>
/// <value>The next.</value>
[JsonProperty("next")]
public string Next { get; set; }

/// <summary>
/// Gets or sets the offset.
/// </summary>
/// <value>The offset.</value>
[JsonProperty("offset")]
public uint Offset { get; set; }

/// <summary>
/// Gets or sets the previous.
/// </summary>
/// <value>The previous.</value>
[JsonProperty("previous")]
public string Previous { get; set; }

/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:plivo.Resource.Meta"/>.
/// </summary>
/// <returns>A <see cref="T:System.String"/> that represents the current <see cref="T:plivo.Resource.Meta"/>.</returns>
public override string ToString()
{
return
"Limit: " + Limit + "\n" +
"Next: " + Next + "\n" +
"Offset: " + Offset + "\n" +
"Previous: " + Previous + "\n";
}
}
}
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.34.0";
public const string SdkVersion = "5.35.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.34.0",
"version": "5.35.0",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
Expand Down

0 comments on commit c19069b

Please sign in to comment.