diff --git a/CHANGELOG.md b/CHANGELOG.md index 923cf3d5..0fa4abe3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [5.47.0](https://github.com/plivo/plivo-dotnet/tree/v5.47.0) (2024-05-28) +**Feature - Number Masking Feature Added** +- Number Masking APIs added to create, update, delete and list sessions + ## [5.46.0](https://github.com/plivo/plivo-dotnet/tree/v5.46.0) (2024-05-20) **Feature - Adding support for location whatsapp messages** - Added new param `location` to [send message API](https://www.plivo.com/docs/sms/api/message#send-a-message) to support location `whatsapp` messages diff --git a/README.md b/README.md index 6fe56df0..cdc98985 100644 --- a/README.md +++ b/README.md @@ -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.46.0 +PM> Install-Package Plivo -Version 5.47.0 ``` You can also use the .NET CLI to install this package as follows ``` -> dotnet add package Plivo --version 5.43.2 +> dotnet add package Plivo --version 5.47.0 ``` ## Getting started diff --git a/src/Plivo/Plivo.csproj b/src/Plivo/Plivo.csproj index 63e20c18..8430e249 100644 --- a/src/Plivo/Plivo.csproj +++ b/src/Plivo/Plivo.csproj @@ -1,7 +1,7 @@ netstandard2.0;netstandard1.3 - 5.46.0 + 5.47.0 Plivo SDKs Team Plivo Inc. diff --git a/src/Plivo/Plivo.nuspec b/src/Plivo/Plivo.nuspec index 5c310c63..46f746ae 100644 --- a/src/Plivo/Plivo.nuspec +++ b/src/Plivo/Plivo.nuspec @@ -4,7 +4,7 @@ A .NET SDK to make voice calls and send SMS using Plivo and to generate Plivo XML A .NET SDK to make voice calls and send SMS using Plivo and to generate Plivo XML Plivo - 5.46.0 + 5.47.0 Plivo Plivo SDKs Team Plivo, Inc. diff --git a/src/Plivo/PlivoApi.cs b/src/Plivo/PlivoApi.cs index 85f3ac36..e8d7908c 100755 --- a/src/Plivo/PlivoApi.cs +++ b/src/Plivo/PlivoApi.cs @@ -6,6 +6,7 @@ using Plivo.Resource.Call; using Plivo.Resource.Conference; using Plivo.Resource.Endpoint; +using Plivo.Resource.MaskingSession; using Plivo.Resource.Message; using Plivo.Resource.VerifySession; using Plivo.Resource.Lookup; @@ -66,6 +67,7 @@ public class PlivoApi private readonly Lazy _profile; private readonly Lazy _media; private readonly Lazy _endpoint; + private readonly Lazy _maskingSession; private readonly Lazy _pricing; private readonly Lazy _recording; private readonly Lazy _number; @@ -148,7 +150,13 @@ public class PlivoApi /// /// The endpoint. public EndpointInterface Endpoint => _endpoint.Value; - + + /// + /// Gets the maskingSession. + /// + /// The maskingSession. + public MaskingSessionInterface MaskingSession => _maskingSession.Value; + /// /// Gets the pricing. /// @@ -206,8 +214,7 @@ public class PlivoApi public TollfreeVerificationInterface TollfreeVerification => _tollfreeVerification.Value; public VerifyCallerIdInterface VerifyCallerId => _verifyCallerId.Value; - - + /// /// Initializes a new instance of the class. /// @@ -243,6 +250,7 @@ public PlivoApi( _campiagn = new Lazy(() => new CampaignInterface(Client)); _media = new Lazy(() => new MediaInterface(Client)); _endpoint = new Lazy(() => new EndpointInterface(Client)); + _maskingSession = new Lazy(() => new MaskingSessionInterface(Client)); _pricing = new Lazy(() => new PricingInterface(Client)); _recording = new Lazy(() => new RecordingInterface(Client)); _number = new Lazy(() => new RentedNumberInterface(Client)); diff --git a/src/Plivo/Resource/ListMaskingSessionResponse.cs b/src/Plivo/Resource/ListMaskingSessionResponse.cs new file mode 100644 index 00000000..2fa52445 --- /dev/null +++ b/src/Plivo/Resource/ListMaskingSessionResponse.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Plivo.Resource +{ + /// + /// List response. + /// + [JsonObject] + public class ListMaskingSessionResponse : BaseResponse, IEnumerable + { + /// + /// Gets or sets the meta. + /// + /// The meta. + public Meta Meta { get; set; } + /// + /// Gets or sets the objects. + /// + /// The objects. + public List Objects { get; set; } + + public NestedResponse Response; + + /// + /// Initializes a new instance of the class. + /// + public ListMaskingSessionResponse() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// Meta. + /// Objects. + public ListMaskingSessionResponse(Meta meta, List objects) + { + Meta = meta ?? throw new ArgumentNullException(nameof(meta)); + Objects = objects ?? throw new ArgumentNullException(nameof(objects)); + } + + /// + /// System.s the collections. IE numerable. get enumerator. + /// + /// The collections. IE numerable. get enumerator. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + /// + /// Gets the enumerator. + /// + /// The enumerator. + public IEnumerator GetEnumerator() + { + return ((IEnumerable)Objects).GetEnumerator(); + } + + /// + /// Returns a that represents the current . + /// + /// A that represents the current . + public override string ToString() + { + return "Api Id: " + ApiId + "\n" + + "[Meta]\n" + Meta + + "[Response]\n" + Response + "\n" + + "StatusCode:" + StatusCode; + } + } +} \ No newline at end of file diff --git a/src/Plivo/Resource/MaskingSession/AsyncResponse.cs b/src/Plivo/Resource/MaskingSession/AsyncResponse.cs new file mode 100644 index 00000000..a57d714c --- /dev/null +++ b/src/Plivo/Resource/MaskingSession/AsyncResponse.cs @@ -0,0 +1,6 @@ +namespace Plivo.Resource.MaskingSession +{ + public class AsyncResponse : BaseResponse + { + } +} \ No newline at end of file diff --git a/src/Plivo/Resource/MaskingSession/MaskingSession.cs b/src/Plivo/Resource/MaskingSession/MaskingSession.cs new file mode 100644 index 00000000..9c121798 --- /dev/null +++ b/src/Plivo/Resource/MaskingSession/MaskingSession.cs @@ -0,0 +1,63 @@ + +using System; +using System.Threading.Tasks; + +namespace Plivo.Resource.MaskingSession +{ + public class MaskingSession : Resource + { + public new string Id => SessionUuid; + public string SessionUuid { get; set; } + public object Response { get; set; } + + public override string ToString() + { + return "ApiId: " + ApiId + "\n"+ + "Response: " + Response + "\n"; + } + + #region Delete + public DeleteResponse Delete() + { + return ((MaskingSessionInterface) Interface).Delete(Id); + } + public async Task DeleteAsync(string Id) + { + return await ((MaskingSessionInterface)Interface).DeleteAsync(Id); + } + #endregion + + + #region Update + public MaskingSessionUpdateResponse Update(string sessionUuid, uint? session_expiry = null, uint? call_time_limit = null, + bool? record = null, string record_file_format = null, string recording_callback_url = null, string callback_url = null, + string callback_method = null, uint? ring_timeout = null, string first_party_play_url = null, string second_party_play_url = null, + string recording_callback_method = null, string subaccount = null, bool? geomatch = null + ) + { + var updateResponse = + ((MaskingSessionInterface) Interface) + .Update(Id, session_expiry, call_time_limit, record, record_file_format, recording_callback_url, callback_url, + callback_method, ring_timeout, first_party_play_url, second_party_play_url, recording_callback_method, + subaccount, geomatch); + return updateResponse; + } + + public async Task UpdateAsync(string sessionUuid, uint? session_expiry = null, uint? call_time_limit = null, + bool? record = null, string record_file_format = null, string recording_callback_url = null, string callback_url = null, + string callback_method = null, uint? ring_timeout = null, string first_party_play_url = null, string second_party_play_url = null, + string recording_callback_method = null, string subaccount = null, bool? geomatch = null + ) + { + var updateResponse = await + ((MaskingSessionInterface)Interface) + .UpdateAsync(Id, session_expiry, call_time_limit, record, record_file_format, recording_callback_url, callback_url, + callback_method, ring_timeout, first_party_play_url, second_party_play_url, recording_callback_method, + subaccount, geomatch); + + return updateResponse; + } + #endregion + + } +} \ No newline at end of file diff --git a/src/Plivo/Resource/MaskingSession/MaskingSessionCreateResponse.cs b/src/Plivo/Resource/MaskingSession/MaskingSessionCreateResponse.cs new file mode 100644 index 00000000..1534ed12 --- /dev/null +++ b/src/Plivo/Resource/MaskingSession/MaskingSessionCreateResponse.cs @@ -0,0 +1,18 @@ + +namespace Plivo.Resource.MaskingSession +{ + public class MaskingSessionCreateResponse : CreateResponse + { + public string SessionUuid { get; set; } + public string VirtualNumber { get; set; } + public object Session { get; set; } + + public override string ToString() + { + return base.ToString() + + "Session Uuid: " + SessionUuid + "\n" + + "VirtualNumber: " + VirtualNumber + "\n" + + "Session: " + Session + "\n"; + } + } +} \ No newline at end of file diff --git a/src/Plivo/Resource/MaskingSession/MaskingSessionInterface.cs b/src/Plivo/Resource/MaskingSession/MaskingSessionInterface.cs new file mode 100644 index 00000000..0eead7f5 --- /dev/null +++ b/src/Plivo/Resource/MaskingSession/MaskingSessionInterface.cs @@ -0,0 +1,356 @@ +using Plivo.Client; +using System.Collections.Generic; +using System.Threading.Tasks; +using Newtonsoft.Json.Linq; +using Newtonsoft.Json; + +namespace Plivo.Resource.MaskingSession +{ + public class MaskingSessionInterface : ResourceInterface + { + public MaskingSessionInterface(HttpClient client) : base(client) + { + Uri = "Account/" + Client.GetAuthId() + "/Masking/Session/"; + } + + #region Create + public MaskingSessionCreateResponse Create( + string firstParty, string secondParty, uint? sessionExpiry = null, uint? callTimeLimit = null, + bool? record = null, string recordFileFormat = null, string recordingCallbackUrl = null, bool? initiateCallToFirstParty = null, + string callbackUrl = null, string callbackMethod = null, uint? ringTimeout = null, string firstPartyPlayUrl = null, + string secondPartyPlayUrl = null, string recordingCallbackMethod = null, bool? isPinAuthenticationRequired = null, + bool? generatePin = null, uint? generatePinLength = null, string firstPartyPin = null, string secondPartyPin = null, + string pinPromptPlay = null, uint? pinRetry = null, uint? pinRetryWait = null, string incorrectPinPlay = null, + string unknownCallerPlay = null, string subaccount = null, bool? geomatch = null + ) + { + var mandatoryParams = new List { "firstParty", "secondParty" }; + bool isVoiceRequest = true; + var data = CreateData( + mandatoryParams, + new + { + firstParty, + secondParty, + sessionExpiry, + callTimeLimit, + record, + recordFileFormat, + recordingCallbackUrl, + initiateCallToFirstParty, + callbackUrl, + callbackMethod, + ringTimeout, + firstPartyPlayUrl, + secondPartyPlayUrl, + recordingCallbackMethod, + isPinAuthenticationRequired, + generatePin, + generatePinLength, + firstPartyPin, + secondPartyPin, + pinPromptPlay, + pinRetry, + pinRetryWait, + incorrectPinPlay, + unknownCallerPlay, + subaccount, + geomatch, + isVoiceRequest + }); + + return ExecuteWithExceptionUnwrap(() => + { + var result = Task.Run(async () => await Client.Update(Uri, data).ConfigureAwait(false)).Result; + result.Object.StatusCode = result.StatusCode; + return result.Object; + }); + } + + public async Task CreateAsync( + string firstParty, string secondParty, uint? sessionExpiry = null, uint? callTimeLimit = null, + bool? record = null, string recordFileFormat = null, string recordingCallbackUrl = null, bool? initiateCallToFirstParty = null, + string callbackUrl = null, string callbackMethod = null, uint? ringTimeout = null, string firstPartyPlayUrl = null, + string secondPartyPlayUrl = null, string recordingCallbackMethod = null, bool? isPinAuthenticationRequired = null, + bool? generatePin = null, uint? generatePinLength = null, string firstPartyPin = null, string secondPartyPin = null, + string pinPromptPlay = null, uint? pinRetry = null, uint? pinRetryWait = null, string incorrectPinPlay = null, + string unknownCallerPlay = null, string subaccount = null, bool? geomatch = null + ) + { + var mandatoryParams = new List { "firstParty", "secondParty" }; + bool isVoiceRequest = true; + var data = CreateData( + mandatoryParams, + new + { + firstParty, + secondParty, + sessionExpiry, + callTimeLimit, + record, + recordFileFormat, + recordingCallbackUrl, + initiateCallToFirstParty, + callbackUrl, + callbackMethod, + ringTimeout, + firstPartyPlayUrl, + secondPartyPlayUrl, + recordingCallbackMethod, + isPinAuthenticationRequired, + generatePin, + generatePinLength, + firstPartyPin, + secondPartyPin, + pinPromptPlay, + pinRetry, + pinRetryWait, + incorrectPinPlay, + unknownCallerPlay, + subaccount, + geomatch, + isVoiceRequest + }); + + var result = Task.Run(async () => await Client.Update(Uri, data).ConfigureAwait(false)).Result; + await Task.WhenAll(); + result.Object.StatusCode = result.StatusCode; + JObject responseJson = JObject.Parse(result.Content); + result.Object.ApiId = responseJson["api_id"].ToString(); + result.Object.Message = responseJson["message"].ToString(); + return result.Object; + } + #endregion + + + #region Get + public MaskingSession Get(string sessionUuid) + { + bool isVoiceRequest = true; + var data = CreateData(new List {""}, new {isVoiceRequest}); + return ExecuteWithExceptionUnwrap(() => + { + var maskingSession = Task.Run(async () => await GetResource(sessionUuid, data).ConfigureAwait(false)).Result; + maskingSession.Interface = this; + return maskingSession; + }); + } + + public async Task GetAsync(string sessionUuid) + { + var data = new Dictionary() + { + {"is_voice_request", true} + }; + var result = Task.Run(async () => await Client.Fetch( + Uri + "/" + sessionUuid + "/", data).ConfigureAwait(false)).Result; + await Task.WhenAll(); + result.Object.StatusCode = result.StatusCode; + JObject responseJson = JObject.Parse(result.Content); + result.Object.ApiId = responseJson["api_id"].ToString(); + result.Object.Message = responseJson["message"].ToString(); + return result.Object; + } + #endregion + + + #region List + public ListMaskingSessionResponse List( + string firstParty = null, string secondParty = null, string virtualNumber = null, string status = null, + string createdTime = null, string createdTime_Lt = null,string createdTime_Gt = null,string createdTime_Lte = null, + string createdTime_Gte = null, string expiryTime = null,string expiryTime_Lt = null,string expiryTime_Gt = null, + string expiryTime_Lte = null,string expiryTime_Gte = null, uint? duration = null,uint? duration_Lt = null, + uint? duration_Gt = null,uint? duration_Lte = null,uint? duration_Gte = null,uint? limit = null, uint? offset = null, + string subaccount=null) + { + var mandatoryParams = new List { "" }; + bool isVoiceRequest = true; + var data = CreateData(mandatoryParams, + new { + firstParty, + secondParty, + virtualNumber, + status, + createdTime, + createdTime_Lt, + createdTime_Gt, + createdTime_Lte, + createdTime_Gte, + expiryTime, + expiryTime_Lt, + expiryTime_Gt, + expiryTime_Lte, + expiryTime_Gte, + duration, + duration_Lt, + duration_Gt, + duration_Lte, + duration_Gte, + limit, + offset, + subaccount, + isVoiceRequest + }); + return ExecuteWithExceptionUnwrap(() => + { + var resources = Task.Run(async () => await ListResources>(data).ConfigureAwait(false)).Result; + if (resources.Response == null) { + return resources; + } else { + resources.Meta = resources.Response.Meta; + JArray responseArray = resources.Response.Objects as JArray; + List maskingSessionList = responseArray.ToObject>(); + resources.Objects = maskingSessionList; + return resources; + } + }); + } + + public async Task ListAsync( + string firstParty = null, string secondParty = null, string virtualNumber = null, string status = null, + string createdTime = null, string createdTime_Lt = null,string createdTime_Gt = null,string createdTime_Lte = null, + string createdTime_Gte = null, string expiryTime = null,string expiryTime_Lt = null,string expiryTime_Gt = null, + string expiryTime_Lte = null,string expiryTime_Gte = null, uint? duration = null,uint? duration_Lt = null, + uint? duration_Gt = null,uint? duration_Lte = null,uint? duration_Gte = null,uint? limit = null, uint? offset = null, + string subaccount=null) + { + var mandatoryParams = new List { "" }; + bool isVoiceRequest = true; + var data = CreateData(mandatoryParams, + new { + firstParty, + secondParty, + virtualNumber, + status, + createdTime, + createdTime_Lt, + createdTime_Gt, + createdTime_Lte, + createdTime_Gte, + expiryTime, + expiryTime_Lt, + expiryTime_Gt, + expiryTime_Lte, + expiryTime_Gte, + duration, + duration_Lt, + duration_Gt, + duration_Lte, + duration_Gte, + limit, + offset, + subaccount, + isVoiceRequest + }); + var result = Task.Run(async () => await Client.Fetch( + Uri, data).ConfigureAwait(false)).Result; + await Task.WhenAll(); + result.Object.StatusCode = result.StatusCode; + JObject responseJson = JObject.Parse(result.Content); + result.Object.ApiId = responseJson["api_id"].ToString(); + result.Object.Message = responseJson["message"].ToString(); + return result.Object; + } + #endregion + + #region Delete + public DeleteResponse Delete(string sessionUuid) + { + return ExecuteWithExceptionUnwrap(() => + { + return Task.Run(async () => await DeleteResource>(sessionUuid, new Dictionary () { {"is_voice_request", true} }).ConfigureAwait(false)).Result; + }); + } + + public async Task DeleteAsync(string sessionUuid) + { + var data = new Dictionary() + { + {"is_voice_request", true} + }; + var result = Task.Run(async () => await Client.Delete( + Uri + "/" + sessionUuid + "/", data).ConfigureAwait(false)).Result; + await Task.WhenAll(); + result.Object.StatusCode = result.StatusCode; + return result.Object; + } + #endregion + + + #region Update + public MaskingSessionUpdateResponse Update(string sessionUuid, uint? sessionExpiry = null, uint? callTimeLimit = null, + bool? record = null, string recordFileFormat = null, string recordingCallbackUrl = null, string callbackUrl = null, + string callbackMethod = null, uint? ringTimeout = null, string firstPartyPlayUrl = null, string secondPartyPlayUrl = null, + string recordingCallbackMethod = null, string subaccount = null, bool? geomatch = null + ) + { + var mandatoryParams = new List { "" }; + bool isVoiceRequest = true; + var data = CreateData( + mandatoryParams, + new + { + sessionExpiry, + callTimeLimit, + record, + recordFileFormat, + recordingCallbackUrl, + callbackUrl, + callbackMethod, + ringTimeout, + firstPartyPlayUrl, + secondPartyPlayUrl, + recordingCallbackMethod, + subaccount, + geomatch, + isVoiceRequest + }); + + return ExecuteWithExceptionUnwrap(() => + { + var result = Task.Run(async () => await Client.Update>(Uri + sessionUuid + "/", data).ConfigureAwait(false)).Result; + var contentJson = JObject.Parse(result.Content); + result.Object.SessionUuid = contentJson["session"]["session_uuid"].ToString(); + result.Object.StatusCode = result.StatusCode; + return result.Object; + }); + } + + public async Task UpdateAsync(string sessionUuid, uint? sessionExpiry = null, uint? callTimeLimit = null, + bool? record = null, string recordFileFormat = null, string recordingCallbackUrl = null, string callbackUrl = null, + string callbackMethod = null, uint? ringTimeout = null, string firstPartyPlayUrl = null, string secondPartyPlayUrl = null, + string recordingCallbackMethod = null, string subaccount = null, bool? geomatch = null + ) + { + var mandatoryParams = new List { "" }; + bool isVoiceRequest = true; + var data = CreateData( + mandatoryParams, + new + { + sessionExpiry, + callTimeLimit, + record, + recordFileFormat, + recordingCallbackUrl, + callbackUrl, + callbackMethod, + ringTimeout, + firstPartyPlayUrl, + secondPartyPlayUrl, + recordingCallbackMethod, + subaccount, + geomatch, + isVoiceRequest + }); + var result = Task.Run(async () => await Client.Update(Uri + sessionUuid + "/", data).ConfigureAwait(false)).Result; + await Task.WhenAll(); + result.Object.StatusCode = result.StatusCode; + JObject responseJson = JObject.Parse(result.Content); + result.Object.ApiId = responseJson["api_id"].ToString(); + result.Object.Message = responseJson["message"].ToString(); + return result.Object; + } + #endregion + } +} \ No newline at end of file diff --git a/src/Plivo/Resource/MaskingSession/MaskingSessionListResponse.cs b/src/Plivo/Resource/MaskingSession/MaskingSessionListResponse.cs new file mode 100644 index 00000000..9b9ecdd2 --- /dev/null +++ b/src/Plivo/Resource/MaskingSession/MaskingSessionListResponse.cs @@ -0,0 +1,164 @@ +using Newtonsoft.Json; + +namespace Plivo.Resource.MaskingSession +{ + public class MaskingSessionListResponse : Resource + { + [JsonProperty("amount")] + public object Amount { get; set; } + + [JsonProperty("call_time_limit")] + public object CallTimeLimit { get; set; } + + [JsonProperty("callback_method")] + public object CallbackMethod { get; set; } + + [JsonProperty("callback_url")] + public object CallbackUrl { get; set; } + + [JsonProperty("created_time")] + public object CreatedTime { get; set; } + + [JsonProperty("duration")] + public object Duration { get; set; } + + [JsonProperty("expiry_time")] + public object Expiry_time { get; set; } + + [JsonProperty("first_party")] + public object FirstParty { get; set; } + + [JsonProperty("first_party_pin")] + public object FirstPartyPin { get; set; } + + [JsonProperty("first_party_play_url")] + public object FirstPartyPlayUrl { get; set; } + + [JsonProperty("generate_pin")] + public object GeneratePin { get; set; } + + [JsonProperty("generate_pin_length")] + public object GeneratePinLength { get; set; } + + [JsonProperty("incorrect_pin_play")] + public object IncorrectPinPlay { get; set; } + + [JsonProperty("initiate_call_to_first_party")] + public object InitiateCallToFirstParty { get; set; } + + [JsonProperty("interaction")] + public object Interaction { get; set; } + + [JsonProperty("is_pin_authentication_required")] + public object IsPinAuthenticationRequired { get; set; } + + [JsonProperty("last_interaction_time")] + public object LastInteractionTime { get; set; } + + [JsonProperty("modified_time")] + public object ModifiedTime { get; set; } + + [JsonProperty("pin_prompt_play")] + public object PinPromptPlay { get; set; } + + [JsonProperty("pin_retry")] + public object PinRetry { get; set; } + + [JsonProperty("pin_retry_wait")] + public object PinRetryWait { get; set; } + + [JsonProperty("record")] + public object Record { get; set; } + + [JsonProperty("record_file_format")] + public object RecordFileFormat { get; set; } + + [JsonProperty("recording_callback_method")] + public object RecordingCallbackMethod { get; set; } + + [JsonProperty("recording_callback_url")] + public object RecordingCallbackUrl { get; set; } + + [JsonProperty("resource_uri")] + public object ResourceUri { get; set; } + + [JsonProperty("ring_timeout")] + public object RingTimeout { get; set; } + + [JsonProperty("second_party")] + public object SecondParty { get; set; } + + [JsonProperty("second_party_pin")] + public object SecondPartyPin { get; set; } + + [JsonProperty("second_party_play_url")] + public object SecondPartyPlayUrl { get; set; } + + [JsonProperty("session_uuid")] + public object SessionUuid { get; set; } + + [JsonProperty("status")] + public object Status { get; set; } + + [JsonProperty("total_call_amount")] + public object TotalCallAmount { get; set; } + + [JsonProperty("total_call_billed_duration")] + public object TotalCallBilledDuration { get; set; } + + [JsonProperty("total_call_count")] + public object TotalCallCount { get; set; } + + [JsonProperty("total_session_amount")] + public object TotalSessionAmount { get; set; } + + [JsonProperty("unknown_caller_play")] + public object UnknownCallerPlay { get; set; } + + [JsonProperty("virtual_number")] + public object VirtualNumber { get; set; } + + public override string ToString() + { + return "Amount: " + Amount + "\n" + + "CallTimeLimit: " + CallTimeLimit + "\n" + + "CallbackMethod: " + CallbackMethod + "\n" + + "CallbackUrl: " + CallbackUrl + "\n" + + "CreatedTime: " + CreatedTime + "\n" + + "Duration: " + Duration + "\n" + + "ExpiryTime: " + Expiry_time + "\n" + + "FirstParty: " + FirstParty + "\n" + + "FirstPartyPin: " + FirstPartyPin + "\n" + + "FirstPartyPlayUrl: " + FirstPartyPlayUrl + "\n" + + "GeneratePin: " + GeneratePin + "\n" + + "GeneratePinLength: " + GeneratePinLength + "\n" + + "IncorrectPinPlay: " + IncorrectPinPlay + "\n" + + "InitiateCallToFirstParty: " + InitiateCallToFirstParty + "\n" + + "Interaction: " + Interaction + "\n" + + "IsPinAuthenticationRequired: " + IsPinAuthenticationRequired + "\n" + + "LastInteractionTime: " + LastInteractionTime + "\n" + + "ModifiedTime: " + ModifiedTime + "\n" + + "PinPromptPlay: " + PinPromptPlay + "\n" + + "PinRetry: " + PinRetry + "\n" + + "PinRetryWait: " + PinRetryWait + "\n" + + "Record: " + Record + "\n" + + "RecordFileFormat: " + RecordFileFormat + "\n" + + "RecordingCallbackMethod: " + RecordingCallbackMethod + "\n" + + "RecordingCallbackUrl: " + RecordingCallbackUrl + "\n" + + "ResourceUri: " + ResourceUri + "\n" + + "RingTimeout: " + RingTimeout + "\n" + + "SecondParty: " + SecondParty + "\n" + + "SecondPartyPin: " + SecondPartyPin + "\n" + + "SecondPartyPlayUrl: " + SecondPartyPlayUrl + "\n" + + "SessionUuid: " + SessionUuid + "\n" + + "Status: " + Status + "\n" + + "TotalCallAmount: " + TotalCallAmount + "\n" + + "TotalCallBilledDuration: " + TotalCallBilledDuration + "\n" + + "TotalCallCount: " + TotalCallCount + "\n" + + "TotalSessionAmount: " + TotalSessionAmount + "\n" + + "UnknownCallerPlay: " + UnknownCallerPlay + "\n" + + "VirtualNumber: " + VirtualNumber + "\n"; + } + + } +} \ No newline at end of file diff --git a/src/Plivo/Resource/MaskingSession/MaskingSessionUpdateResponse.cs b/src/Plivo/Resource/MaskingSession/MaskingSessionUpdateResponse.cs new file mode 100644 index 00000000..288c521a --- /dev/null +++ b/src/Plivo/Resource/MaskingSession/MaskingSessionUpdateResponse.cs @@ -0,0 +1,16 @@ +namespace Plivo.Resource.MaskingSession +{ + public class MaskingSessionUpdateResponse : BaseResponse + { + public object Session { get; set; } + + public string SessionUuid { get; set; } + + public override string ToString() + { + return base.ToString() + + "SessionUuid: " + SessionUuid + "\n" + + "Session: " + Session + "\n"; + } + } +} \ No newline at end of file diff --git a/src/Plivo/Resource/NestedResponse.cs b/src/Plivo/Resource/NestedResponse.cs new file mode 100644 index 00000000..567bebfe --- /dev/null +++ b/src/Plivo/Resource/NestedResponse.cs @@ -0,0 +1,15 @@ +namespace Plivo.Resource +{ + public class NestedResponse + { + public Meta Meta { get; set; } + + public object Objects { get; set; } + + public override string ToString() + { + return + "[Objects]\n" + string.Join("\n", Objects); + } + } +} \ No newline at end of file diff --git a/src/Plivo/Version.cs b/src/Plivo/Version.cs index 8700e756..b9e96dab 100644 --- a/src/Plivo/Version.cs +++ b/src/Plivo/Version.cs @@ -10,7 +10,7 @@ public class Version /// /// DotNet SDK version /// - public const string SdkVersion = "5.46.0"; + public const string SdkVersion = "5.47.0"; /// /// Plivo API version /// diff --git a/version.json b/version.json index 5e0ebe7f..04743731 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "5.46.0", + "version": "5.47.0", "publicReleaseRefSpec": [ "^refs/heads/master$", "^refs/heads/v\\d+(?:\\.\\d+)?$"