Skip to content

Commit

Permalink
Merge pull request #266 from plivo/add-error-details-for-campaigns
Browse files Browse the repository at this point in the history
Add new response params for get and list campaign
  • Loading branch information
renoldthomas-plivo authored Dec 1, 2023
2 parents d921b4a + cda6628 commit 645d516
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 11 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.41.0](https://github.com/plivo/plivo-dotnet/tree/v5.41.0) (2023-11-29)
**Feature - new response field error_code and error_reason**
- Added new response field `error_code and error_reason`for LIST / GET Campaign APIs

## [5.40.0](https://github.com/plivo/plivo-dotnet/tree/v5.40.0) (2023-11-12)
**Feature - registration_status field**
- Added new param `registration_status` in LIST Campaign APIs
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.40.0
PM> Install-Package Plivo -Version 5.41.0
```

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

```
> dotnet add package Plivo --version 5.40.0
> dotnet add package Plivo --version 5.41.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.40.0</ReleaseVersion>
<ReleaseVersion>5.41.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.40.0</version>
<version>5.41.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.41.0 Added New Params `error_code`, `error_reason` for GET and LIST Campaign.
* 5.40.0 Added New Params `registration_status`.
* 5.39.0 API support for verifying, updating, getting and deleting caller IDs.
* 5.38.0 Adding verify service APIs.
Expand Down
11 changes: 11 additions & 0 deletions src/Plivo/Resource/Campaign/Campaign.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ public class CampaignResponse
[JsonProperty("campaign_source")]
public string CampaignSource { get; set; }

[JsonProperty("error_code")]
public string ErrorCode { get; set; }

[JsonProperty("error_reason")]
public string ErrorReason { get; set; }
}

[JsonObject(MemberSerialization.OptIn)]
Expand Down Expand Up @@ -220,6 +225,12 @@ public class ListCampaigns: Resource
[JsonProperty("campaign_source")]
public string CampaignSource { get; set; }

[JsonProperty("error_code")]
public string ErrorCode { get; set; }

[JsonProperty("error_reason")]
public string ErrorReason { get; set; }

public override string ToString()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
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.40.0";
public const string SdkVersion = "5.41.0";
/// <summary>
/// Plivo API version
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"subscriber_help": false,
"affiliate_marketing": false
},
"campaign_source": "plivo"
"campaign_source": "plivo",
"error_code": "1001",
"error_reason": "The campaign content falls under a prohibited content category."
}
}
16 changes: 12 additions & 4 deletions tests_netcore/Plivo.NetCore.Test/Mocks/campaignListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
},
"reseller_id": "",
"usecase": "MIXED",
"campaign_source": "plivo"
"campaign_source": "plivo",
"error_code": "1001",
"error_reason": "The campaign content falls under a prohibited content category."
},
{
"brand_id": "BHYYNCK",
Expand All @@ -55,7 +57,9 @@
"campaign_id": "CWOOIAT",
"reseller_id": "",
"usecase": "2FA",
"campaign_source": "plivo"
"campaign_source": "plivo",
"error_code": "1001",
"error_reason": "The campaign content falls under a prohibited content category."
},
{
"brand_id": "BHYYNCK",
Expand All @@ -74,7 +78,9 @@
},
"reseller_id": "",
"usecase": "MIXED",
"campaign_source": "plivo"
"campaign_source": "plivo",
"error_code": "1001",
"error_reason": "The campaign content falls under a prohibited content category."
},
{
"brand_id": "BRPXS6E",
Expand All @@ -91,7 +97,9 @@
},
"reseller_id": "",
"usecase": "ACCOUNT_NOTIFICATION",
"campaign_source": "plivo"
"campaign_source": "plivo",
"error_code": "1001",
"error_reason": "The campaign content falls under a prohibited content category."
}
]
}
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.40.0",
"version": "5.41.0",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
Expand Down

0 comments on commit 645d516

Please sign in to comment.