Skip to content

Commit

Permalink
Merge pull request #258 from plivo/campaign-import
Browse files Browse the repository at this point in the history
SMS-6400 - campaign filter based on campaign source
  • Loading branch information
renoldthomas-plivo authored Oct 20, 2023
2 parents c19069b + 4bcc92f commit b07ae29
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 19 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.36.0](https://github.com/plivo/plivo-dotnet/tree/v5.36.0) (2023-10-20)
**Feature - campaign_source field**
- Added new param `campaign_source` in LIST / GET Campaign APIs

## [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
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.35.0
PM> Install-Package Plivo -Version 5.36.0
```

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

```
> dotnet add package Plivo --version 5.35.0
> dotnet add package Plivo --version 5.36.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.35.0</ReleaseVersion>
<ReleaseVersion>5.36.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.35.0</version>
<version>5.36.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.36.0 Added New Params `campaign_source`.
* 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`.
Expand Down
7 changes: 7 additions & 0 deletions src/Plivo/Resource/Campaign/Campaign.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ public class CampaignResponse

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

[JsonProperty("campaign_source")]
public string CampaignSource { get; set; }

}

[JsonObject(MemberSerialization.OptIn)]
Expand Down Expand Up @@ -207,6 +211,9 @@ public class ListCampaigns: Resource
[JsonProperty("created_at")]
public string CreatedAt { get; set; }

[JsonProperty("campaign_source")]
public string CampaignSource { get; set; }

public override string ToString()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
Expand Down
22 changes: 15 additions & 7 deletions src/Plivo/Resource/Campaign/CampaignInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,21 @@ public async Task<GetCampaign> GetAsync(string campaignID)
/// List campaign list type and status.
/// </summary>
/// <returns>The list.</returns>
/// <param name="brand">brand.</param>
/// <param name="brand_id">brand_id.</param>
/// <param name="usecase">usecase.</param>
public CampaignListResponse<ListCampaigns> List(uint? limit = null, uint? offset = null)
/// <param name="campaign_source">campaign_source</param>
public CampaignListResponse<ListCampaigns> List(uint? limit = null, uint? offset = null, string brand_id =null, string usecase=null, string campaign_source="plivo")
{
var mandatoryParams = new List<string> {""};
var data = CreateData(
mandatoryParams,
new
{
limit,
offset
offset,
campaign_source,
brand_id,
usecase
});

return ExecuteWithExceptionUnwrap(() =>
Expand All @@ -78,17 +82,21 @@ public CampaignListResponse<ListCampaigns> List(uint? limit = null, uint? offset
/// List Brand list type and status.
/// </summary>
/// <returns>The list.</returns>
/// <param name="brand">brand.</param>
/// <param name="usecase">status.</param>
public async Task<CampaignListResponse<ListCampaigns>> ListAsync(uint? limit = null, uint? offset = null)
/// <param name="brand_id">brand_id.</param>
/// <param name="usecase">usercase.</param>
/// <param name="campaign_source">campaign_source</param>
public async Task<CampaignListResponse<ListCampaigns>> ListAsync(uint? limit = null, uint? offset = null, string brand_id =null, string usecase=null, string campaign_source="plivo")
{
var mandatoryParams = new List<string> {""};
var data = CreateData(
mandatoryParams,
new
{
limit,
offset
offset,
campaign_source,
brand_id,
usecase
});

var resources = await ListResources<CampaignListResponse<ListCampaigns>>("10dlc/Campaign", data);
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.35.0";
public const string SdkVersion = "5.36.0";
/// <summary>
/// Plivo API version
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"subscriber_optout": false,
"subscriber_help": false,
"affiliate_marketing": false
}
},
"campaign_source": "plivo"
}
}
15 changes: 10 additions & 5 deletions tests_netcore/Plivo.NetCore.Test/Mocks/campaignListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"Verizon Wireless": {}
},
"reseller_id": "",
"usecase": "MIXED"
"usecase": "MIXED",
"campaign_source": "plivo"
},
{
"brand_id": "BHYYNCK",
Expand All @@ -46,13 +47,15 @@
"Verizon Wireless": {}
},
"reseller_id": "RPDPPUM",
"usecase": "ACCOUNT_NOTIFICATION"
"usecase": "ACCOUNT_NOTIFICATION",
"campaign_source": "plivo"
},
{
"brand_id": "B8OD95Z",
"campaign_id": "CWOOIAT",
"reseller_id": "",
"usecase": "2FA"
"usecase": "2FA",
"campaign_source": "plivo"
},
{
"brand_id": "BHYYNCK",
Expand All @@ -70,7 +73,8 @@
}
},
"reseller_id": "",
"usecase": "MIXED"
"usecase": "MIXED",
"campaign_source": "plivo"
},
{
"brand_id": "BRPXS6E",
Expand All @@ -86,7 +90,8 @@
"Verizon Wireless": {}
},
"reseller_id": "",
"usecase": "ACCOUNT_NOTIFICATION"
"usecase": "ACCOUNT_NOTIFICATION",
"campaign_source": "plivo"
}
]
}
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.35.0",
"version": "5.36.0",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
Expand Down

0 comments on commit b07ae29

Please sign in to comment.