diff --git a/.gitignore b/.gitignore index 0f4dcf77..a1ab18a5 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,6 @@ Thumbs.db *.dotCover /.vs /TestProject + +# rider +.idea diff --git a/CHANGELOG.md b/CHANGELOG.md index 506673ae..a3d36367 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Change Log +## [v4.8.2](https://github.com/plivo/plivo-dotnet/tree/v4.8.1) (2020-05-19) +- Fix List All Rented Numbers API response. + ## [v4.8.1](https://github.com/plivo/plivo-dotnet/tree/v4.8.1) (2020-05-19) - Add Send MMS using Media_ID support. diff --git a/src/Plivo/Plivo.csproj b/src/Plivo/Plivo.csproj index 4443f089..6972a510 100644 --- a/src/Plivo/Plivo.csproj +++ b/src/Plivo/Plivo.csproj @@ -1,7 +1,7 @@ netstandard2.0;netstandard1.3 - 4.8.1 + 4.8.2 Plivo SDKs Team Plivo Inc. diff --git a/src/Plivo/Plivo.nuspec b/src/Plivo/Plivo.nuspec index e163d11f..1a2ae105 100755 --- a/src/Plivo/Plivo.nuspec +++ b/src/Plivo/Plivo.nuspec @@ -12,6 +12,7 @@ http://github.com/plivo/plivo-dotnet false + * 4.8.2 Fix List All Rented Numbers API response. * 4.8.1 Add Send MMS using Media_ID support. * 4.8.0 Add V3 signature helper functions. * 4.7.1 Fix Bulk call API response. diff --git a/src/Plivo/Resource/RentedNumber/RentedNumber.cs b/src/Plivo/Resource/RentedNumber/RentedNumber.cs index e552d8d2..f81af57d 100755 --- a/src/Plivo/Resource/RentedNumber/RentedNumber.cs +++ b/src/Plivo/Resource/RentedNumber/RentedNumber.cs @@ -1,14 +1,21 @@ +using System; using System.Collections.Generic; using System.Threading.Tasks; -namespace Plivo.Resource.RentedNumber { - public class RentedNumber : Resource { - +namespace Plivo.Resource.RentedNumber +{ + public class RentedNumber : Resource + { public new string Id => Number; + public bool Active { get; set; } public string AddedOn { get; set; } public object Alias { get; set; } public string Application { get; set; } public string Carrier { get; set; } + public string City { get; set; } + public string Country { get; set; } + public bool MmsEnabled { get; set; } + public string MmsRate { get; set; } public string MonthlyRentalRate { get; set; } public string Number { get; set; } public string NumberType { get; set; } @@ -17,27 +24,59 @@ public class RentedNumber : Resource { public bool SmsEnabled { get; set; } public string SmsRate { get; set; } public object SubAccount { get; set; } + public string Type { get; set; } + public List VerificationInfo { get; set; } public bool VoiceEnabled { get; set; } public string VoiceRate { get; set; } - public List Prerequisites { get; set; } - public List VerificationInfo { get; set; } - public string City { get; set; } - public string Country { get; set; } - - public override string ToString () { + + public override string ToString() + { + if (string.Compare(Carrier, "Plivo", StringComparison.Ordinal) == 0) + { + return + "Active: " + Active + "\n" + + "AddedOn: " + AddedOn + "\n" + + "Alias: " + Alias + "\n" + + "Application: " + Application + "\n" + + "Carrier: " + Carrier + "\n" + + "City: " + City + "\n" + + "Country: " + Country + "\n" + + "MmsEnabled: " + MmsEnabled + "\n" + + "MmsRate: " + MmsRate + "\n" + + "MonthlyRentalRate: " + MonthlyRentalRate + "\n" + + "Number: " + Number + "\n" + + "NumberType: " + NumberType + "\n" + + "Region: " + Region + "\n" + + "ResourceUri: " + ResourceUri + "\n" + + "SmsEnabled: " + SmsEnabled + "\n" + + "SmsRate: " + SmsRate + "\n" + + "SubAccount: " + SubAccount + "\n" + + "Type: " + Type + "\n" + + "VerificationInfo: " + VerificationInfo.ToString() + "\n" + + "VoiceEnabled: " + VoiceEnabled + "\n" + + "VoiceRate: " + VoiceRate + "\n"; + } return - "Addedon: " + AddedOn + "\n" + - "Alias " + Alias + "\n" + + "Active: " + Active + "\n" + + "AddedOn: " + AddedOn + "\n" + + "Alias: " + Alias + "\n" + "Application: " + Application + "\n" + - "SMSEnabled: " + SmsEnabled + "\n" + - "SMSrate " + SmsRate + "\n" + - "VoiceEnabled: " + VoiceEnabled + "\n" + - "VoiceRate: " + VoiceRate + "\n" + + "Carrier: " + Carrier + "\n" + + "MonthlyRentalRate: " + MonthlyRentalRate + "\n" + + "Number: " + Number + "\n" + + "NumberType: " + NumberType + "\n" + "Region: " + Region + "\n" + - "MonthlyRentalRate " + MonthlyRentalRate + "\n"; + "ResourceUri: " + ResourceUri + "\n" + + "SmsEnabled: " + SmsEnabled + "\n" + + "SmsRate: " + SmsRate + "\n" + + "SubAccount: " + SubAccount + "\n" + + "Type: " + Type + "\n" + + "VoiceEnabled: " + VoiceEnabled + "\n" + + "VoiceRate: " + VoiceRate + "\n"; } #region Update + /// /// Update RentedNumber with the specified appId, subAccount and alias. /// @@ -45,25 +84,27 @@ public override string ToString () { /// App identifier. /// SubAccount. /// Alias. - public UpdateResponse Update ( - string appId = null, string subAccount = null, string alias = null) { + public UpdateResponse Update( + string appId = null, string subAccount = null, string alias = null) + { var updateResponse = ((RentedNumberInterface) Interface) - .Update (Id, appId, subAccount, alias); + .Update(Id, appId, subAccount, alias); if (appId != null) Application = - "/v1/Account/" + - ((RentedNumberInterface) Interface).Client.GetAuthId () + - "/Application/" + - appId + - "/"; + "/v1/Account/" + + ((RentedNumberInterface) Interface).Client.GetAuthId() + + "/Application/" + + appId + + "/"; if (appId == "null") Application = null; if (subAccount != null) SubAccount = subAccount; if (alias != null) Alias = alias; return updateResponse; } + /// /// Update RentedNumber with the specified appId, subAccount and alias. /// @@ -71,43 +112,50 @@ public UpdateResponse Update ( /// App identifier. /// SubAccount. /// Alias. - public async Task> UpdateAsync ( - string appId = null, string subAccount = null, string alias = null) { + public async Task> UpdateAsync( + string appId = null, string subAccount = null, string alias = null) + { var updateResponse = await ((RentedNumberInterface) Interface) - .UpdateAsync (Id, appId, subAccount, alias); + .UpdateAsync(Id, appId, subAccount, alias); if (appId != null) Application = - "/v1/Account/" + - ((RentedNumberInterface) Interface).Client.GetAuthId () + - "/Application/" + - appId + - "/"; + "/v1/Account/" + + ((RentedNumberInterface) Interface).Client.GetAuthId() + + "/Application/" + + appId + + "/"; if (appId == "null") Application = null; if (subAccount != null) SubAccount = subAccount; if (alias != null) Alias = alias; return updateResponse; } + #endregion #region Delete + /// /// Unrent RentedNumber. /// /// The delete. - public void Delete () { + public void Delete() + { ((RentedNumberInterface) Interface) - .Delete (Id); + .Delete(Id); } + /// /// Asynchronously unrent RentedNumber. /// /// The delete. - public async void DeleteAsync () { + public async void DeleteAsync() + { await ((RentedNumberInterface) Interface) - .DeleteAsync (Id); + .DeleteAsync(Id); } + #endregion } } \ No newline at end of file diff --git a/src/Plivo/Version.cs b/src/Plivo/Version.cs index 005bcea7..bbc6e672 100755 --- a/src/Plivo/Version.cs +++ b/src/Plivo/Version.cs @@ -10,7 +10,7 @@ public class Version /// /// DotNet SDK version /// - public const string SdkVersion = "4.8.1"; + public const string SdkVersion = "4.8.2"; /// /// Plivo API version ///