Skip to content

Commit

Permalink
PHONUM-2816 (#251)
Browse files Browse the repository at this point in the history
* changes for cnam lookup

* bump version

---------

Co-authored-by: kalyan-plivo <[email protected]>
  • Loading branch information
kapilp93 and kalyan-plivo authored Jun 2, 2023
1 parent 728b2d1 commit c6d8ef6
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 25 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Change Log

## [5.30.0](https://github.com/plivo/plivo-dotnet/tree/v5.30.0) (2023-05-02)
**Feature - CNAM Lookup**
- Added New Param `cnam_lookup` in to the response of the [list all numbers API], [list single number API]
- Added `cnam_lookup` filter to AccountPhoneNumber - list all my numbers API.
- Added `cnam_lookup` parameter to buy number[Buy a Phone Number] to configure CNAM Lookup while buying a US number
- Added `cnam_lookup` parameter to update number[Update an account phone number] to configure CNAM Lookup while buying a US number

## [v5.29.0](https://github.com/plivo/plivo-dotnet/tree/v5.23.1) (2023-03-16)
**Feature - Added New Param 'cnam_lookup_number_config' in GetCall and ListCalls**
- Add `cnam_lookup_number_config` to the response for the [retrieve a call details API](https://www.plivo.com/docs/voice/api/call#retrieve-a-call) and the [retreive all call details API](https://www.plivo.com/docs/voice/api/call#retrieve-all-calls)
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.28.0</ReleaseVersion>
<ReleaseVersion>5.30.0</ReleaseVersion>
<Version />
<Authors>Plivo SDKs Team</Authors>
<Owners>Plivo Inc.</Owners>
Expand Down
4 changes: 3 additions & 1 deletion src/Plivo/Plivo.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
<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.28.0</version>
<version>5.30.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.30.0 Added New Param 'cnam_lookup' in to the response of the [list all numbers API], [list single number API]
* 5.29.0 Added New Param 'cnam_lookup_number_config' in GetCall and ListCalls
* 5.28.0 Added new Params 'MonthlyRecordingStorageAmount', 'RecordingStorageRate', 'RecordingStorageDuration' and 'RoundedRecordingDuration' to List Recordings and Get Recording APIs
* 5.27.0 Added New Param 'renewalDate' in GetNumbers and ListNumbers. Add 5 new filters to AccountPhoneNumber - list all my numbers API:'renewal_date', 'renewal_date__gt', 'renewal_date__gte','renewal_date__lt' and 'renewal_date__lte'
* 5.26.0 Added new param 'ReplacedSender' to the response
Expand Down
10 changes: 6 additions & 4 deletions src/Plivo/Resource/PhoneNumber/PhoneNumber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,21 @@ public override string ToString()
/// </summary>
/// <returns>The buy.</returns>
/// <param name="appId">App identifier.</param>
public PhoneNumberBuyResponse Buy(string appId = null)
/// <param name="cnamLookup">CnamLookup.</param>
public PhoneNumberBuyResponse Buy(string appId = null, string cnamLookup = null)
{
return ((PhoneNumberInterface) Interface).Buy(Id, appId);
return ((PhoneNumberInterface) Interface).Buy(Id, appId, cnamLookup);
}
/// <summary>
/// Asynchronously buy PhoneNumber and associate it with
/// application whose Id id appId.
/// </summary>
/// <returns>The buy.</returns>
/// <param name="appId">App identifier.</param>
public async Task<PhoneNumberBuyResponse> BuyAsync(string appId = null)
/// <param name="cnamLookup">Cnam Lookup</param>
public async Task<PhoneNumberBuyResponse> BuyAsync(string appId = null, string cnamLookup = null)
{
return await ((PhoneNumberInterface)Interface).BuyAsync(Id, appId);
return await ((PhoneNumberInterface)Interface).BuyAsync(Id, appId, cnamLookup);
}
#endregion
}
Expand Down
12 changes: 7 additions & 5 deletions src/Plivo/Resource/PhoneNumber/PhoneNumberInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,13 @@ public async Task<ListResponse<PhoneNumber>> ListAsync(
/// <param name="number">Number.</param>
/// <param name="appId">App identifier.</param>
/// <param name="verificationInfo">Verification information. address_id and identity_id are the keys</param>
public PhoneNumberBuyResponse Buy(string number, string appId = null,
Dictionary<string, string> verificationInfo = null)
/// <param name="cnamLookup">Cnam Lookup</param>
public PhoneNumberBuyResponse Buy(string number, string appId = null, string cnamLookup = null,
Dictionary<string, string> verificationInfo = null )
{
var mandatoryParams = new List<string> {""};
var data = CreateData(
mandatoryParams, new {appId, verificationInfo});
mandatoryParams, new {appId, verificationInfo, cnamLookup});

return ExecuteWithExceptionUnwrap(() =>
{
Expand All @@ -157,12 +158,13 @@ public PhoneNumberBuyResponse Buy(string number, string appId = null,
/// <param name="number">Number.</param>
/// <param name="appId">App identifier.</param>
/// <param name="verificationInfo">Verification information. address_id and identity_id are the keys</param>
public async Task<PhoneNumberBuyResponse> BuyAsync(string number, string appId = null,
/// <param name="cnamLookup">Cnam Lookup</param>
public async Task<PhoneNumberBuyResponse> BuyAsync(string number, string appId = null, string cnamLookup = null,
Dictionary<string, string> verificationInfo = null)
{
var mandatoryParams = new List<string> { "" };
var data = CreateData(
mandatoryParams, new { appId, verificationInfo });
mandatoryParams, new { appId, verificationInfo, cnamLookup });
var result = await Client.Update<PhoneNumberBuyResponse>(
Uri + number + "/",
data
Expand Down
3 changes: 3 additions & 0 deletions src/Plivo/Resource/RentedNumber/RentedNumber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class RentedNumber : Resource
public string TendlcRegistrationStatus {get; set;}
public string TollFreeSmsVerification {get; set;}
public string RenewalDate {get; set;}
public string CnamLookup {get; set;}

public override string ToString()
{
Expand All @@ -48,6 +49,7 @@ public override string ToString()
"Carrier: " + Carrier + "\n" +
"City: " + City + "\n" +
"Country: " + Country + "\n" +
"CnamLookup: " + CnamLookup + "\n" +
"MmsEnabled: " + MmsEnabled + "\n" +
"MmsRate: " + MmsRate + "\n" +
"MonthlyRentalRate: " + MonthlyRentalRate + "\n" +
Expand Down Expand Up @@ -75,6 +77,7 @@ public override string ToString()
"Alias: " + Alias + "\n" +
"Application: " + Application + "\n" +
"Carrier: " + Carrier + "\n" +
"CnamLookup: " + CnamLookup + "\n" +
"MonthlyRentalRate: " + MonthlyRentalRate + "\n" +
"Number: " + Number + "\n" +
"NumberType: " + NumberType + "\n" +
Expand Down
15 changes: 11 additions & 4 deletions src/Plivo/Resource/RentedNumber/RentedNumberInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public async Task<RentedNumber> GetAsync(string number)
/// <param name="renewalDate_Lte">Renewal Date Less Than or Equal</param>
/// <param name="renewalDate_Gt">Renewal Date Greater Than</param>
/// <param name="renewalDate_Gte">Renewal Date Greater Than or Equal</param>
/// <param name="cnamLookup">Cnam Lookup configuration</param>
public ListResponse<RentedNumber> List(
string type = null, string numberStartswith = null,
string subaccount = null, string alias = null,
Expand All @@ -80,6 +81,7 @@ public ListResponse<RentedNumber> List(
string renewalDate = null,
string renewalDate_Lt = null, string renewalDate_Lte = null,
string renewalDate_Gt = null, string renewalDate_Gte = null,
string cnamLookup = null,
uint? limit = null, uint? offset = null)
{
var mandatoryParams = new List<string> {""};
Expand All @@ -100,6 +102,7 @@ public ListResponse<RentedNumber> List(
renewalDate_Lte,
renewalDate_Gte,
renewalDate_Gt,
cnamLookup,
limit,
offset
});
Expand Down Expand Up @@ -233,9 +236,10 @@ public async Task<UpdateResponse<RentedNumber>> AddNumberAsync(
/// <param name="subaccount">Subaccount.</param>
/// <param name="alias">Alias.</param>
/// <param name="verificationInfo">Verification Information.</param>
/// <param name="cnamLookup">Cnam Lookup.</param>
public UpdateResponse<RentedNumber> Update(
string number, string appId = null, string subaccount = null,
string alias = null, Dictionary<string, string> verificationInfo = null)
string alias = null, Dictionary<string, string> verificationInfo = null, string cnamLookup = null)
{
var mandatoryParams = new List<string> {""};
var data = CreateData(
Expand All @@ -245,7 +249,8 @@ public UpdateResponse<RentedNumber> Update(
appId,
subaccount,
alias,
verificationInfo
verificationInfo,
cnamLookup
});
if (appId == "null") data["app_id"] = null;

Expand All @@ -268,9 +273,10 @@ public UpdateResponse<RentedNumber> Update(
/// <param name="subaccount">Subaccount.</param>
/// <param name="alias">Alias.</param>
/// <param name="verificationInfo">Verification Information.</param>
/// <param name="cnamLookup">Cnam Lookup.</param>
public async Task<UpdateResponse<RentedNumber>> UpdateAsync(
string number, string appId = null, string subaccount = null,
string alias = null, Dictionary<string, string> verificationInfo = null)
string alias = null, Dictionary<string, string> verificationInfo = null, string cnamLookup = null)
{
var mandatoryParams = new List<string> { "" };
var data = CreateData(
Expand All @@ -280,7 +286,8 @@ public async Task<UpdateResponse<RentedNumber>> UpdateAsync(
appId,
subaccount,
alias,
verificationInfo
verificationInfo,
cnamLookup
});
if (appId == "null") data["app_id"] = null;
var result = await Client.Update<UpdateResponse<RentedNumber>>(
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.29.0";
public const string SdkVersion = "5.30.0";
/// <summary>
/// Plivo API version
/// </summary>
Expand Down
3 changes: 2 additions & 1 deletion tests/Plivo.Test/Mocks/numberGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
"tendlc_campaign_id": "ACB1234",
"tendlc_registration_status": "COMPLETED",
"toll_free_sms_verification": "verified",
"renewal_date": "2023-05-01"
"renewal_date": "2023-05-01",
"cnam_lookup": "enabled"
}
9 changes: 6 additions & 3 deletions tests/Plivo.Test/Mocks/numberListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"tendlc_campaign_id": "ACB1234",
"tendlc_registration_status": "COMPLETED",
"toll_free_sms_verification": "verified",
"renewal_date": "2023-05-01"
"renewal_date": "2023-05-01",
"cnam_lookup": "enabled"
},
{
"added_on": "2013-01-01",
Expand All @@ -46,7 +47,8 @@
"tendlc_campaign_id": "ACB1234",
"tendlc_registration_status": "COMPLETED",
"toll_free_sms_verification": "verified",
"renewal_date": "2023-05-01"
"renewal_date": "2023-05-01",
"cnam_lookup": "enabled"
},
{
"added_on": "2013-03-25",
Expand All @@ -66,7 +68,8 @@
"tendlc_campaign_id": "ACB1234",
"tendlc_registration_status": "COMPLETED",
"toll_free_sms_verification": "verified",
"renewal_date": "2023-05-01"
"renewal_date": "2023-05-01",
"cnam_lookup": "enabled"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
"tendlc_campaign_id": "ACB1234",
"tendlc_registration_status": "COMPLETED",
"toll_free_sms_verification": null,
"renewal_date": "2023-05-01"
"renewal_date": "2023-05-01",
"cnam_lookup": "enabled"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"tendlc_campaign_id" : "ABC1234",
"tendlc_registration_status": "completed",
"toll_free_sms_verification": null,
"renewal_date": "2023-05-01"
"renewal_date": "2023-05-01",
"cnam_lookup": "enabled"
},
{
"added_on": "2013-01-01",
Expand All @@ -46,7 +47,8 @@
"tendlc_campaign_id" : "ABC1235",
"tendlc_registration_status": "completed",
"toll_free_sms_verification": null,
"renewal_date": "2023-05-01"
"renewal_date": "2023-05-01",
"cnam_lookup": "enabled"
},
{
"added_on": "2013-03-25",
Expand All @@ -66,7 +68,8 @@
"tendlc_campaign_id" : null,
"tendlc_registration_status": null,
"toll_free_sms_verification": "verified",
"renewal_date": "2023-05-01"
"renewal_date": "2023-05-01",
"cnam_lookup": "enabled"
}
]
}
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.29.0",
"version": "5.30.0",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
Expand Down

0 comments on commit c6d8ef6

Please sign in to comment.