From f5dcdd715d1f17bc0b2cd9686ab79b20a6436038 Mon Sep 17 00:00:00 2001 From: jmulford-bw Date: Mon, 8 Mar 2021 21:40:18 +0000 Subject: [PATCH 1/4] New deploy --- ...> IMultiFactorAuthBasicAuthCredentials.cs} | 2 +- ....cs => MultiFactorAuthBasicAuthManager.cs} | 4 +- Bandwidth.Standard/Bandwidth.Standard.csproj | 8 +- Bandwidth.Standard/BandwidthClient.cs | 66 +++-- .../Http/Client/HttpClientConfiguration.cs | 6 + Bandwidth.Standard/Http/Client/HttpContext.cs | 6 + .../Http/Request/HttpRequest.cs | 13 + .../Http/Response/HttpResponse.cs | 8 + .../Http/Response/HttpStringResponse.cs | 9 +- Bandwidth.Standard/IConfiguration.cs | 4 +- .../Messaging/Controllers/APIController.cs | 165 ++++++------ ...cs => MessagingExceptionErrorException.cs} | 5 +- .../Models/BandwidthCallbackMessage.cs | 78 ++++++ .../Messaging/Models/BandwidthMessage.cs | 120 +++++++++ .../Messaging/Models/BandwidthMessageItem.cs | 113 ++++++++ .../Messaging/Models/BandwidthMessagesList.cs | 57 ++++ .../Messaging/Models/DeferredResult.cs | 50 ++++ Bandwidth.Standard/Messaging/Models/Media.cs | 117 ++++---- .../Messaging/Models/MessageRequest.cs | 85 ++++++ .../Messaging/Models/MessagingException.cs | 94 +++++++ .../Messaging/Models/PageInfo.cs | 64 +++++ Bandwidth.Standard/Messaging/Models/Tag.cs | 50 ++++ .../Controllers/MFAController.cs | 42 +-- .../ErrorWithRequestErrorException.cs} | 9 +- .../ForbiddenRequestErrorException.cs} | 9 +- .../UnauthorizedRequestErrorException.cs} | 9 +- .../Models/ErrorWithRequest.cs | 94 +++++++ .../Models/ForbiddenRequest.cs | 79 ++++++ .../Models/TwoFactorCodeRequestSchema.cs | 150 +++++++++++ .../Models/TwoFactorMessagingResponse.cs | 79 ++++++ .../Models/TwoFactorVerifyCodeResponse.cs | 79 ++++++ .../Models/TwoFactorVerifyRequestSchema.cs | 135 ++++++++++ .../Models/TwoFactorVoiceResponse.cs | 79 ++++++ .../Models/UnauthorizedRequest.cs | 79 ++++++ .../MultiFactorAuthClient.cs} | 8 +- Bandwidth.Standard/Server.cs | 2 +- .../Models/TwoFactorCodeRequestSchema.cs | 76 ------ .../Models/TwoFactorMessagingResponse.cs | 36 --- .../Models/TwoFactorVerifyCodeResponse.cs | 36 --- .../Models/TwoFactorVerifyRequestSchema.cs | 68 ----- .../Models/TwoFactorVoiceResponse.cs | 36 --- .../Voice/Controllers/APIController.cs | 254 +++++++++--------- ...n.cs => ApiErrorResponseErrorException.cs} | 5 +- .../Voice/Models/ApiCallResponse.cs | 168 ++++++++++++ .../Voice/Models/ApiCallStateResponse.cs | 171 ++++++++++++ .../Voice/Models/ApiCreateCallRequest.cs | 169 ++++++++++++ .../Voice/Models/ApiErrorResponse.cs | 109 ++++++++ .../Voice/Models/ApiModifyCallRequest.cs | 106 ++++++++ .../Models/ApiModifyConferenceRequest.cs | 99 +++++++ .../Models/ApiTranscribeRecordingRequest.cs | 78 ++++++ .../Voice/Models/ConferenceDetail.cs | 92 +++++++ .../Voice/Models/ConferenceMemberDetail.cs | 78 ++++++ .../ConferenceRecordingMetadataResponse.cs | 113 ++++++++ .../Voice/Models/ModifyCallRecordingState.cs | 39 +++ .../Voice/Models/RecordingMetadataResponse.cs | 162 +++++++++++ Bandwidth.Standard/Voice/Models/Transcript.cs | 50 ++++ .../Voice/Models/Transcription.cs | 64 +++++ .../Voice/Models/TranscriptionResponse.cs | 43 +++ .../WebRtc/Controllers/APIController.cs | 22 +- ...rorException.cs => ErrorErrorException.cs} | 5 +- .../Models/AccountsParticipantsResponse.cs | 50 ++++ .../WebRtc/Models/DeviceApiVersionEnum.cs | 79 ++++++ Bandwidth.Standard/WebRtc/Models/Error.cs | 90 +++++++ .../WebRtc/Models/Participant.cs | 95 ++++++- .../WebRtc/Models/ParticipantSubscription.cs | 43 +++ Bandwidth.Standard/WebRtc/Models/Session.cs | 50 ++++ .../WebRtc/Models/Subscriptions.cs | 50 ++++ .../Messaging/APIControllerTest.cs | 16 +- Bandwidth.sln | 20 +- 69 files changed, 3914 insertions(+), 635 deletions(-) rename Bandwidth.Standard/Authentication/{ITwoFactorAuthBasicAuthCredentials.cs => IMultiFactorAuthBasicAuthCredentials.cs} (89%) rename Bandwidth.Standard/Authentication/{TwoFactorAuthBasicAuthManager.cs => MultiFactorAuthBasicAuthManager.cs} (92%) rename Bandwidth.Standard/Messaging/Exceptions/{MessagingException.cs => MessagingExceptionErrorException.cs} (85%) create mode 100644 Bandwidth.Standard/Messaging/Models/MessagingException.cs rename Bandwidth.Standard/{TwoFactorAuth => MultiFactorAuth}/Controllers/MFAController.cs (82%) rename Bandwidth.Standard/{TwoFactorAuth/Exceptions/ErrorWithRequestException.cs => MultiFactorAuth/Exceptions/ErrorWithRequestErrorException.cs} (80%) rename Bandwidth.Standard/{TwoFactorAuth/Exceptions/ForbiddenRequestException.cs => MultiFactorAuth/Exceptions/ForbiddenRequestErrorException.cs} (78%) rename Bandwidth.Standard/{TwoFactorAuth/Exceptions/UnauthorizedRequestException.cs => MultiFactorAuth/Exceptions/UnauthorizedRequestErrorException.cs} (77%) create mode 100644 Bandwidth.Standard/MultiFactorAuth/Models/ErrorWithRequest.cs create mode 100644 Bandwidth.Standard/MultiFactorAuth/Models/ForbiddenRequest.cs create mode 100644 Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorCodeRequestSchema.cs create mode 100644 Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorMessagingResponse.cs create mode 100644 Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVerifyCodeResponse.cs create mode 100644 Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVerifyRequestSchema.cs create mode 100644 Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVoiceResponse.cs create mode 100644 Bandwidth.Standard/MultiFactorAuth/Models/UnauthorizedRequest.cs rename Bandwidth.Standard/{TwoFactorAuth/TwoFactorAuthClient.cs => MultiFactorAuth/MultiFactorAuthClient.cs} (78%) delete mode 100644 Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorCodeRequestSchema.cs delete mode 100644 Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorMessagingResponse.cs delete mode 100644 Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVerifyCodeResponse.cs delete mode 100644 Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVerifyRequestSchema.cs delete mode 100644 Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVoiceResponse.cs rename Bandwidth.Standard/Voice/Exceptions/{ApiErrorResponseException.cs => ApiErrorResponseErrorException.cs} (88%) create mode 100644 Bandwidth.Standard/Voice/Models/ApiErrorResponse.cs rename Bandwidth.Standard/WebRtc/Exceptions/{ErrorException.cs => ErrorErrorException.cs} (87%) create mode 100644 Bandwidth.Standard/WebRtc/Models/DeviceApiVersionEnum.cs create mode 100644 Bandwidth.Standard/WebRtc/Models/Error.cs diff --git a/Bandwidth.Standard/Authentication/ITwoFactorAuthBasicAuthCredentials.cs b/Bandwidth.Standard/Authentication/IMultiFactorAuthBasicAuthCredentials.cs similarity index 89% rename from Bandwidth.Standard/Authentication/ITwoFactorAuthBasicAuthCredentials.cs rename to Bandwidth.Standard/Authentication/IMultiFactorAuthBasicAuthCredentials.cs index 2dabfe2a..04c245c3 100644 --- a/Bandwidth.Standard/Authentication/ITwoFactorAuthBasicAuthCredentials.cs +++ b/Bandwidth.Standard/Authentication/IMultiFactorAuthBasicAuthCredentials.cs @@ -2,7 +2,7 @@ namespace Bandwidth.Standard.Authentication { - public interface ITwoFactorAuthBasicAuthCredentials + public interface IMultiFactorAuthBasicAuthCredentials { /// /// Getter for basicAuthUserName diff --git a/Bandwidth.Standard/Authentication/TwoFactorAuthBasicAuthManager.cs b/Bandwidth.Standard/Authentication/MultiFactorAuthBasicAuthManager.cs similarity index 92% rename from Bandwidth.Standard/Authentication/TwoFactorAuthBasicAuthManager.cs rename to Bandwidth.Standard/Authentication/MultiFactorAuthBasicAuthManager.cs index bd51aa37..09e95bf5 100644 --- a/Bandwidth.Standard/Authentication/TwoFactorAuthBasicAuthManager.cs +++ b/Bandwidth.Standard/Authentication/MultiFactorAuthBasicAuthManager.cs @@ -6,12 +6,12 @@ namespace Bandwidth.Standard.Authentication { - internal class TwoFactorAuthBasicAuthManager : ITwoFactorAuthBasicAuthCredentials, IAuthManager + internal class MultiFactorAuthBasicAuthManager : IMultiFactorAuthBasicAuthCredentials, IAuthManager { /// /// Constructor /// - public TwoFactorAuthBasicAuthManager(string username, string password) + public MultiFactorAuthBasicAuthManager(string username, string password) { BasicAuthUserName = username; BasicAuthPassword = password; diff --git a/Bandwidth.Standard/Bandwidth.Standard.csproj b/Bandwidth.Standard/Bandwidth.Standard.csproj index 5137fccd..180390be 100644 --- a/Bandwidth.Standard/Bandwidth.Standard.csproj +++ b/Bandwidth.Standard/Bandwidth.Standard.csproj @@ -9,13 +9,13 @@ netstandard1.3 Bandwidth.Sdk - 5.0.0.0 + 1.0.0.0 Bandwidth.Standard Copyright © 2019 - 5.0.0.0 - 5.0.0.0 + 1.0.0.0 + 1.0.0.0 .NET client library for the bandwidth API 7.3 @@ -28,4 +28,4 @@ - + \ No newline at end of file diff --git a/Bandwidth.Standard/BandwidthClient.cs b/Bandwidth.Standard/BandwidthClient.cs index 37404c80..1eb3a56a 100644 --- a/Bandwidth.Standard/BandwidthClient.cs +++ b/Bandwidth.Standard/BandwidthClient.cs @@ -11,7 +11,7 @@ using Bandwidth.Standard.Authentication; using Bandwidth.Standard.Http.Client; using Bandwidth.Standard.Messaging; -using Bandwidth.Standard.TwoFactorAuth; +using Bandwidth.Standard.MultiFactorAuth; using Bandwidth.Standard.Voice; using Bandwidth.Standard.WebRtc; @@ -29,11 +29,11 @@ public sealed class BandwidthClient: IConfiguration internal readonly IHttpClient httpClient; internal readonly HttpCallBack httpCallBack; private readonly MessagingBasicAuthManager messagingBasicAuthManager; - private readonly TwoFactorAuthBasicAuthManager twoFactorAuthBasicAuthManager; + private readonly MultiFactorAuthBasicAuthManager multiFactorAuthBasicAuthManager; private readonly VoiceBasicAuthManager voiceBasicAuthManager; private readonly WebRtcBasicAuthManager webRtcBasicAuthManager; private readonly Lazy messaging; - private readonly Lazy twoFactorAuth; + private readonly Lazy multiFactorAuth; private readonly Lazy voice; private readonly Lazy webRtc; @@ -43,9 +43,9 @@ public sealed class BandwidthClient: IConfiguration public MessagingClient Messaging => messaging.Value; /// - /// Provides access to TwoFactorAuthClient controller. + /// Provides access to MultiFactorAuthClient controller. /// - public TwoFactorAuthClient TwoFactorAuth => twoFactorAuth.Value; + public MultiFactorAuthClient MultiFactorAuth => multiFactorAuth.Value; /// /// Provides access to VoiceClient controller. @@ -66,8 +66,8 @@ internal static BandwidthClient CreateFromEnvironment() string baseUrl = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_BASE_URL"); string messagingBasicAuthUserName = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_MESSAGING_BASIC_AUTH_USER_NAME"); string messagingBasicAuthPassword = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_MESSAGING_BASIC_AUTH_PASSWORD"); - string twoFactorAuthBasicAuthUserName = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_TWO_FACTOR_AUTH_BASIC_AUTH_USER_NAME"); - string twoFactorAuthBasicAuthPassword = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_TWO_FACTOR_AUTH_BASIC_AUTH_PASSWORD"); + string multiFactorAuthBasicAuthUserName = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_MULTI_FACTOR_AUTH_BASIC_AUTH_USER_NAME"); + string multiFactorAuthBasicAuthPassword = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_MULTI_FACTOR_AUTH_BASIC_AUTH_PASSWORD"); string voiceBasicAuthUserName = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_VOICE_BASIC_AUTH_USER_NAME"); string voiceBasicAuthPassword = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_VOICE_BASIC_AUTH_PASSWORD"); string webRtcBasicAuthUserName = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_WEB_RTC_BASIC_AUTH_USER_NAME"); @@ -93,9 +93,9 @@ internal static BandwidthClient CreateFromEnvironment() builder.MessagingBasicAuthCredentials(messagingBasicAuthUserName, messagingBasicAuthPassword); } - if (twoFactorAuthBasicAuthUserName != null && twoFactorAuthBasicAuthPassword != null) + if (multiFactorAuthBasicAuthUserName != null && multiFactorAuthBasicAuthPassword != null) { - builder.TwoFactorAuthBasicAuthCredentials(twoFactorAuthBasicAuthUserName, twoFactorAuthBasicAuthPassword); + builder.MultiFactorAuthBasicAuthCredentials(multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword); } if (voiceBasicAuthUserName != null && voiceBasicAuthPassword != null) @@ -113,7 +113,7 @@ internal static BandwidthClient CreateFromEnvironment() private BandwidthClient(TimeSpan timeout, Environment environment, string baseUrl, string messagingBasicAuthUserName, string messagingBasicAuthPassword, - string twoFactorAuthBasicAuthUserName, string twoFactorAuthBasicAuthPassword, + string multiFactorAuthBasicAuthUserName, string multiFactorAuthBasicAuthPassword, string voiceBasicAuthUserName, string voiceBasicAuthPassword, string webRtcBasicAuthUserName, string webRtcBasicAuthPassword, IDictionary authManagers, IHttpClient httpClient, @@ -139,16 +139,16 @@ private BandwidthClient(TimeSpan timeout, Environment environment, string baseUr this.authManagers["messaging"] = messagingBasicAuthManager; } - if (this.authManagers.ContainsKey("twoFactorAuth")) + if (this.authManagers.ContainsKey("multiFactorAuth")) { - twoFactorAuthBasicAuthManager = (TwoFactorAuthBasicAuthManager) this.authManagers["twoFactorAuth"]; + multiFactorAuthBasicAuthManager = (MultiFactorAuthBasicAuthManager) this.authManagers["multiFactorAuth"]; } - if (!this.authManagers.ContainsKey("twoFactorAuth") - || !TwoFactorAuthBasicAuthCredentials.Equals(twoFactorAuthBasicAuthUserName, twoFactorAuthBasicAuthPassword)) + if (!this.authManagers.ContainsKey("multiFactorAuth") + || !MultiFactorAuthBasicAuthCredentials.Equals(multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword)) { - twoFactorAuthBasicAuthManager = new TwoFactorAuthBasicAuthManager(twoFactorAuthBasicAuthUserName, twoFactorAuthBasicAuthPassword); - this.authManagers["twoFactorAuth"] = twoFactorAuthBasicAuthManager; + multiFactorAuthBasicAuthManager = new MultiFactorAuthBasicAuthManager(multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword); + this.authManagers["multiFactorAuth"] = multiFactorAuthBasicAuthManager; } if (this.authManagers.ContainsKey("voice")) @@ -176,7 +176,7 @@ private BandwidthClient(TimeSpan timeout, Environment environment, string baseUr } messaging = new Lazy(() => new MessagingClient(this)); - twoFactorAuth = new Lazy(() => new TwoFactorAuthClient(this)); + multiFactorAuth = new Lazy(() => new MultiFactorAuthClient(this)); voice = new Lazy(() => new VoiceClient(this)); webRtc = new Lazy(() => new WebRtcClient(this)); } @@ -192,9 +192,9 @@ private BandwidthClient(TimeSpan timeout, Environment environment, string baseUr public IMessagingBasicAuthCredentials MessagingBasicAuthCredentials { get => messagingBasicAuthManager; } /// - /// The credentials to use with TwoFactorAuthBasicAuth + /// The credentials to use with MultiFactorAuthBasicAuth /// - public ITwoFactorAuthBasicAuthCredentials TwoFactorAuthBasicAuthCredentials { get => twoFactorAuthBasicAuthManager; } + public IMultiFactorAuthBasicAuthCredentials MultiFactorAuthBasicAuthCredentials { get => multiFactorAuthBasicAuthManager; } /// /// The credentials to use with VoiceBasicAuth @@ -230,7 +230,7 @@ private BandwidthClient(TimeSpan timeout, Environment environment, string baseUr { { Server.Default, "api.bandwidth.com" }, { Server.MessagingDefault, "https://messaging.bandwidth.com/api/v2" }, - { Server.TwoFactorAuthDefault, "https://mfa.bandwidth.com/api/v1" }, + { Server.MultiFactorAuthDefault, "https://mfa.bandwidth.com/api/v1" }, { Server.VoiceDefault, "https://voice.bandwidth.com" }, { Server.WebRtcDefault, "https://api.webrtc.bandwidth.com/v1" }, } @@ -240,7 +240,7 @@ private BandwidthClient(TimeSpan timeout, Environment environment, string baseUr { { Server.Default, "{base_url}" }, { Server.MessagingDefault, "{base_url}" }, - { Server.TwoFactorAuthDefault, "{base_url}" }, + { Server.MultiFactorAuthDefault, "{base_url}" }, { Server.VoiceDefault, "{base_url}" }, { Server.WebRtcDefault, "{base_url}" }, } @@ -283,7 +283,7 @@ public Builder ToBuilder() .Environment(Environment) .BaseUrl(BaseUrl) .MessagingBasicAuthCredentials(messagingBasicAuthManager.BasicAuthUserName, messagingBasicAuthManager.BasicAuthPassword) - .TwoFactorAuthBasicAuthCredentials(twoFactorAuthBasicAuthManager.BasicAuthUserName, twoFactorAuthBasicAuthManager.BasicAuthPassword) + .MultiFactorAuthBasicAuthCredentials(multiFactorAuthBasicAuthManager.BasicAuthUserName, multiFactorAuthBasicAuthManager.BasicAuthPassword) .VoiceBasicAuthCredentials(voiceBasicAuthManager.BasicAuthUserName, voiceBasicAuthManager.BasicAuthPassword) .WebRtcBasicAuthCredentials(webRtcBasicAuthManager.BasicAuthUserName, webRtcBasicAuthManager.BasicAuthPassword) .HttpCallBack(httpCallBack) @@ -293,6 +293,14 @@ public Builder ToBuilder() return builder; } + public override string ToString() + { + return + $"Environment = {Environment}, " + + $"BaseUrl = {BaseUrl}, " + + $"HttpClientConfiguration = {HttpClientConfiguration}, "; + } + public class Builder { private TimeSpan timeout = TimeSpan.FromSeconds(100); @@ -300,8 +308,8 @@ public class Builder private string baseUrl = "https://www.example.com"; private string messagingBasicAuthUserName = "TODO: Replace"; private string messagingBasicAuthPassword = "TODO: Replace"; - private string twoFactorAuthBasicAuthUserName = "TODO: Replace"; - private string twoFactorAuthBasicAuthPassword = "TODO: Replace"; + private string multiFactorAuthBasicAuthUserName = "TODO: Replace"; + private string multiFactorAuthBasicAuthPassword = "TODO: Replace"; private string voiceBasicAuthUserName = "TODO: Replace"; private string voiceBasicAuthPassword = "TODO: Replace"; private string webRtcBasicAuthUserName = "TODO: Replace"; @@ -323,12 +331,12 @@ public Builder MessagingBasicAuthCredentials(string messagingBasicAuthUserName, } /// - /// Credentials setter for TwoFactorAuthBasicAuth + /// Credentials setter for MultiFactorAuthBasicAuth /// - public Builder TwoFactorAuthBasicAuthCredentials(string twoFactorAuthBasicAuthUserName, string twoFactorAuthBasicAuthPassword) + public Builder MultiFactorAuthBasicAuthCredentials(string multiFactorAuthBasicAuthUserName, string multiFactorAuthBasicAuthPassword) { - this.twoFactorAuthBasicAuthUserName = twoFactorAuthBasicAuthUserName ?? throw new ArgumentNullException(nameof(twoFactorAuthBasicAuthUserName)); - this.twoFactorAuthBasicAuthPassword = twoFactorAuthBasicAuthPassword ?? throw new ArgumentNullException(nameof(twoFactorAuthBasicAuthPassword)); + this.multiFactorAuthBasicAuthUserName = multiFactorAuthBasicAuthUserName ?? throw new ArgumentNullException(nameof(multiFactorAuthBasicAuthUserName)); + this.multiFactorAuthBasicAuthPassword = multiFactorAuthBasicAuthPassword ?? throw new ArgumentNullException(nameof(multiFactorAuthBasicAuthPassword)); return this; } @@ -422,7 +430,7 @@ public BandwidthClient Build() } return new BandwidthClient(timeout, environment, baseUrl, messagingBasicAuthUserName, messagingBasicAuthPassword, - twoFactorAuthBasicAuthUserName, twoFactorAuthBasicAuthPassword, voiceBasicAuthUserName, + multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword, voiceBasicAuthUserName, voiceBasicAuthPassword, webRtcBasicAuthUserName, webRtcBasicAuthPassword, authManagers, httpClient, httpCallBack, httpClientConfig); } diff --git a/Bandwidth.Standard/Http/Client/HttpClientConfiguration.cs b/Bandwidth.Standard/Http/Client/HttpClientConfiguration.cs index 4afe6d92..8202f848 100644 --- a/Bandwidth.Standard/Http/Client/HttpClientConfiguration.cs +++ b/Bandwidth.Standard/Http/Client/HttpClientConfiguration.cs @@ -16,5 +16,11 @@ public HttpClientConfiguration() /// Http client timeout /// public TimeSpan Timeout { get; internal set; } + + public override string ToString() + { + return "HttpClientConfiguration: " + + $"{Timeout} "; + } } } diff --git a/Bandwidth.Standard/Http/Client/HttpContext.cs b/Bandwidth.Standard/Http/Client/HttpContext.cs index 0094b190..68babc6a 100644 --- a/Bandwidth.Standard/Http/Client/HttpContext.cs +++ b/Bandwidth.Standard/Http/Client/HttpContext.cs @@ -29,5 +29,11 @@ public HttpContext(HttpRequest request, HttpResponse response) Request = request; Response = response; } + + public override string ToString() + { + return $" Request = {Request}, " + + $" Response = {Response}"; + } } } diff --git a/Bandwidth.Standard/Http/Request/HttpRequest.cs b/Bandwidth.Standard/Http/Request/HttpRequest.cs index 59065f75..7519d9ba 100644 --- a/Bandwidth.Standard/Http/Request/HttpRequest.cs +++ b/Bandwidth.Standard/Http/Request/HttpRequest.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Net.Http; +using Bandwidth.Standard.Utilities; namespace Bandwidth.Standard.Http.Request { @@ -138,5 +139,17 @@ public void AddQueryParameters(Dictionary queryParamaters) QueryParameters = QueryParameters.Concat(queryParamaters).ToDictionary(x => x.Key, x => x.Value); } } + + public override string ToString() + { + return $" HttpMethod = {HttpMethod}, " + + $" QueryUrl = {QueryUrl}, " + + $" QueryParameters = {ApiHelper.JsonSerialize(QueryParameters)}, " + + $" Headers = {ApiHelper.JsonSerialize(Headers)}, " + + $" FormParameters = {ApiHelper.JsonSerialize(FormParameters)}, " + + $" Body = {Body}, " + + $" Username = {Username}, " + + $" Password = {Password}"; + } } } diff --git a/Bandwidth.Standard/Http/Response/HttpResponse.cs b/Bandwidth.Standard/Http/Response/HttpResponse.cs index 5ea280bb..527d32d4 100644 --- a/Bandwidth.Standard/Http/Response/HttpResponse.cs +++ b/Bandwidth.Standard/Http/Response/HttpResponse.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using Bandwidth.Standard.Utilities; namespace Bandwidth.Standard.Http.Response { @@ -33,5 +34,12 @@ public HttpResponse(int statusCode, Dictionary headers, Stream r this.Headers = headers; this.RawBody = rawBody; } + + public override string ToString() + { + return $" StatusCode = {StatusCode}, " + + $" Headers = {ApiHelper.JsonSerialize(Headers)}, " + + $" RawBody = {RawBody}"; + } } } diff --git a/Bandwidth.Standard/Http/Response/HttpStringResponse.cs b/Bandwidth.Standard/Http/Response/HttpStringResponse.cs index c82a3023..0d036b7f 100644 --- a/Bandwidth.Standard/Http/Response/HttpStringResponse.cs +++ b/Bandwidth.Standard/Http/Response/HttpStringResponse.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.IO; +using Bandwidth.Standard.Utilities; namespace Bandwidth.Standard.Http.Response { @@ -23,5 +24,11 @@ public HttpStringResponse(int statusCode, Dictionary headers, St { this.Body = body; } + + public override string ToString() + { + return $"Body = {Body}" + + $"{base.ToString()}: "; + } } -} +} \ No newline at end of file diff --git a/Bandwidth.Standard/IConfiguration.cs b/Bandwidth.Standard/IConfiguration.cs index 444cd50c..92b87313 100644 --- a/Bandwidth.Standard/IConfiguration.cs +++ b/Bandwidth.Standard/IConfiguration.cs @@ -26,9 +26,9 @@ public interface IConfiguration IMessagingBasicAuthCredentials MessagingBasicAuthCredentials { get; } /// - /// The credentials to use with TwoFactorAuthBasicAuth + /// The credentials to use with MultiFactorAuthBasicAuth /// - ITwoFactorAuthBasicAuthCredentials TwoFactorAuthBasicAuthCredentials { get; } + IMultiFactorAuthBasicAuthCredentials MultiFactorAuthBasicAuthCredentials { get; } /// /// The credentials to use with VoiceBasicAuth diff --git a/Bandwidth.Standard/Messaging/Controllers/APIController.cs b/Bandwidth.Standard/Messaging/Controllers/APIController.cs index 3f63dace..e032902e 100644 --- a/Bandwidth.Standard/Messaging/Controllers/APIController.cs +++ b/Bandwidth.Standard/Messaging/Controllers/APIController.cs @@ -32,12 +32,12 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar /// /// listMedia /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Optional parameter: Continuation token used to retrieve subsequent media. /// Returns the ApiResponse> response from the API call - public ApiResponse> ListMedia(string userId, string continuationToken = null) + public ApiResponse> ListMedia(string accountId, string continuationToken = null) { - Task>> t = ListMediaAsync(userId, continuationToken); + Task>> t = ListMediaAsync(accountId, continuationToken); ApiHelper.RunTaskSynchronously(t); return t.Result; } @@ -45,22 +45,22 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar /// /// listMedia /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Optional parameter: Continuation token used to retrieve subsequent media. /// Returns the ApiResponse> response from the API call - public async Task>> ListMediaAsync(string userId, string continuationToken = null, CancellationToken cancellationToken = default) + public async Task>> ListMediaAsync(string accountId, string continuationToken = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(Server.MessagingDefault); //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); - _queryBuilder.Append("/users/{userId}/media"); + _queryBuilder.Append("/users/{accountId}/media"); //process optional template parameters ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() { - { "userId", userId } + { "accountId", accountId } }); //append request with appropriate headers and parameters @@ -92,32 +92,32 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new MessagingException("400 Request is malformed or invalid", _context); + throw new MessagingExceptionErrorException("400 Request is malformed or invalid", _context); } if (_response.StatusCode == 401) { - throw new MessagingException("401 The specified user does not have access to the account", _context); + throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", _context); } if (_response.StatusCode == 403) { - throw new MessagingException("403 The user does not have access to this API", _context); + throw new MessagingExceptionErrorException("403 The user does not have access to this API", _context); } if (_response.StatusCode == 404) { - throw new MessagingException("404 Path not found", _context); + throw new MessagingExceptionErrorException("404 Path not found", _context); } if (_response.StatusCode == 415) { - throw new MessagingException("415 The content-type of the request is incorrect", _context); + throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", _context); } if (_response.StatusCode == 429) { - throw new MessagingException("429 The rate limit has been reached", _context); + throw new MessagingExceptionErrorException("429 The rate limit has been reached", _context); } //handle errors defined at the API level @@ -131,12 +131,12 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar /// /// getMedia /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Required parameter: Media ID to retrieve /// Returns the ApiResponse response from the API call - public ApiResponse GetMedia(string userId, string mediaId) + public ApiResponse GetMedia(string accountId, string mediaId) { - Task> t = GetMediaAsync(userId, mediaId); + Task> t = GetMediaAsync(accountId, mediaId); ApiHelper.RunTaskSynchronously(t); return t.Result; } @@ -144,22 +144,22 @@ public ApiResponse GetMedia(string userId, string mediaId) /// /// getMedia /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Required parameter: Media ID to retrieve /// Returns the ApiResponse response from the API call - public async Task> GetMediaAsync(string userId, string mediaId, CancellationToken cancellationToken = default) + public async Task> GetMediaAsync(string accountId, string mediaId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(Server.MessagingDefault); //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); - _queryBuilder.Append("/users/{userId}/media/{mediaId}"); + _queryBuilder.Append("/users/{accountId}/media/{mediaId}"); //process optional template parameters ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() { - { "userId", userId }, + { "accountId", accountId }, { "mediaId", mediaId } }); @@ -190,32 +190,32 @@ public async Task> GetMediaAsync(string userId, string media //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new MessagingException("400 Request is malformed or invalid", _context); + throw new MessagingExceptionErrorException("400 Request is malformed or invalid", _context); } if (_response.StatusCode == 401) { - throw new MessagingException("401 The specified user does not have access to the account", _context); + throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", _context); } if (_response.StatusCode == 403) { - throw new MessagingException("403 The user does not have access to this API", _context); + throw new MessagingExceptionErrorException("403 The user does not have access to this API", _context); } if (_response.StatusCode == 404) { - throw new MessagingException("404 Path not found", _context); + throw new MessagingExceptionErrorException("404 Path not found", _context); } if (_response.StatusCode == 415) { - throw new MessagingException("415 The content-type of the request is incorrect", _context); + throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", _context); } if (_response.StatusCode == 429) { - throw new MessagingException("429 The rate limit has been reached", _context); + throw new MessagingExceptionErrorException("429 The rate limit has been reached", _context); } //handle errors defined at the API level @@ -229,39 +229,35 @@ public async Task> GetMediaAsync(string userId, string media /// /// uploadMedia /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Required parameter: The user supplied custom media ID - /// Required parameter: The size of the entity-body /// Required parameter: Example: /// Optional parameter: The media type of the entity-body /// Optional parameter: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. /// Returns the void response from the API call public void UploadMedia( - string userId, + string accountId, string mediaId, - long contentLength, FileStreamInfo body, string contentType = "application/octet-stream", string cacheControl = null) { - Task t = UploadMediaAsync(userId, mediaId, contentLength, body, contentType, cacheControl); + Task t = UploadMediaAsync(accountId, mediaId, body, contentType, cacheControl); ApiHelper.RunTaskSynchronously(t); } /// /// uploadMedia /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Required parameter: The user supplied custom media ID - /// Required parameter: The size of the entity-body /// Required parameter: Example: /// Optional parameter: The media type of the entity-body /// Optional parameter: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. /// Returns the void response from the API call public async Task UploadMediaAsync( - string userId, + string accountId, string mediaId, - long contentLength, FileStreamInfo body, string contentType = "application/octet-stream", string cacheControl = null, CancellationToken cancellationToken = default) @@ -271,12 +267,12 @@ public async Task UploadMediaAsync( //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); - _queryBuilder.Append("/users/{userId}/media/{mediaId}"); + _queryBuilder.Append("/users/{accountId}/media/{mediaId}"); //process optional template parameters ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() { - { "userId", userId }, + { "accountId", accountId }, { "mediaId", mediaId } }); @@ -284,7 +280,6 @@ public async Task UploadMediaAsync( var _headers = new Dictionary() { { "user-agent", userAgent }, - { "Content-Length", contentLength.ToString() }, { "Content-Type", (null != contentType) ? contentType : "application/octet-stream" }, { "Cache-Control", cacheControl } }; @@ -313,32 +308,32 @@ public async Task UploadMediaAsync( //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new MessagingException("400 Request is malformed or invalid", _context); + throw new MessagingExceptionErrorException("400 Request is malformed or invalid", _context); } if (_response.StatusCode == 401) { - throw new MessagingException("401 The specified user does not have access to the account", _context); + throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", _context); } if (_response.StatusCode == 403) { - throw new MessagingException("403 The user does not have access to this API", _context); + throw new MessagingExceptionErrorException("403 The user does not have access to this API", _context); } if (_response.StatusCode == 404) { - throw new MessagingException("404 Path not found", _context); + throw new MessagingExceptionErrorException("404 Path not found", _context); } if (_response.StatusCode == 415) { - throw new MessagingException("415 The content-type of the request is incorrect", _context); + throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", _context); } if (_response.StatusCode == 429) { - throw new MessagingException("429 The rate limit has been reached", _context); + throw new MessagingExceptionErrorException("429 The rate limit has been reached", _context); } //handle errors defined at the API level @@ -349,34 +344,34 @@ public async Task UploadMediaAsync( /// /// deleteMedia /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Required parameter: The media ID to delete /// Returns the void response from the API call - public void DeleteMedia(string userId, string mediaId) + public void DeleteMedia(string accountId, string mediaId) { - Task t = DeleteMediaAsync(userId, mediaId); + Task t = DeleteMediaAsync(accountId, mediaId); ApiHelper.RunTaskSynchronously(t); } /// /// deleteMedia /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Required parameter: The media ID to delete /// Returns the void response from the API call - public async Task DeleteMediaAsync(string userId, string mediaId, CancellationToken cancellationToken = default) + public async Task DeleteMediaAsync(string accountId, string mediaId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(Server.MessagingDefault); //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); - _queryBuilder.Append("/users/{userId}/media/{mediaId}"); + _queryBuilder.Append("/users/{accountId}/media/{mediaId}"); //process optional template parameters ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() { - { "userId", userId }, + { "accountId", accountId }, { "mediaId", mediaId } }); @@ -407,32 +402,32 @@ public async Task DeleteMediaAsync(string userId, string mediaId, CancellationTo //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new MessagingException("400 Request is malformed or invalid", _context); + throw new MessagingExceptionErrorException("400 Request is malformed or invalid", _context); } if (_response.StatusCode == 401) { - throw new MessagingException("401 The specified user does not have access to the account", _context); + throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", _context); } if (_response.StatusCode == 403) { - throw new MessagingException("403 The user does not have access to this API", _context); + throw new MessagingExceptionErrorException("403 The user does not have access to this API", _context); } if (_response.StatusCode == 404) { - throw new MessagingException("404 Path not found", _context); + throw new MessagingExceptionErrorException("404 Path not found", _context); } if (_response.StatusCode == 415) { - throw new MessagingException("415 The content-type of the request is incorrect", _context); + throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", _context); } if (_response.StatusCode == 429) { - throw new MessagingException("429 The rate limit has been reached", _context); + throw new MessagingExceptionErrorException("429 The rate limit has been reached", _context); } //handle errors defined at the API level @@ -443,11 +438,11 @@ public async Task DeleteMediaAsync(string userId, string mediaId, CancellationTo /// /// getMessages /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Optional parameter: The ID of the message to search for. Special characters need to be encoded using URL encoding /// Optional parameter: The phone number that sent the message /// Optional parameter: The phone number that received the message - /// Optional parameter: The status of the message. One of RECEIVED, QUEUED, SENDING, SENT, FAILED, DELIVERED, DLR_EXPIRED + /// Optional parameter: The status of the message. One of RECEIVED, QUEUED, SENDING, SENT, FAILED, DELIVERED, ACCEPTED, UNDELIVERED /// Optional parameter: The error code of the message /// Optional parameter: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. /// Optional parameter: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. @@ -455,7 +450,7 @@ public async Task DeleteMediaAsync(string userId, string mediaId, CancellationTo /// Optional parameter: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000 /// Returns the ApiResponse response from the API call public ApiResponse GetMessages( - string userId, + string accountId, string messageId = null, string sourceTn = null, string destinationTn = null, @@ -466,7 +461,7 @@ public async Task DeleteMediaAsync(string userId, string mediaId, CancellationTo string pageToken = null, int? limit = null) { - Task> t = GetMessagesAsync(userId, messageId, sourceTn, destinationTn, messageStatus, errorCode, fromDateTime, toDateTime, pageToken, limit); + Task> t = GetMessagesAsync(accountId, messageId, sourceTn, destinationTn, messageStatus, errorCode, fromDateTime, toDateTime, pageToken, limit); ApiHelper.RunTaskSynchronously(t); return t.Result; } @@ -474,11 +469,11 @@ public async Task DeleteMediaAsync(string userId, string mediaId, CancellationTo /// /// getMessages /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Optional parameter: The ID of the message to search for. Special characters need to be encoded using URL encoding /// Optional parameter: The phone number that sent the message /// Optional parameter: The phone number that received the message - /// Optional parameter: The status of the message. One of RECEIVED, QUEUED, SENDING, SENT, FAILED, DELIVERED, DLR_EXPIRED + /// Optional parameter: The status of the message. One of RECEIVED, QUEUED, SENDING, SENT, FAILED, DELIVERED, ACCEPTED, UNDELIVERED /// Optional parameter: The error code of the message /// Optional parameter: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. /// Optional parameter: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. @@ -486,7 +481,7 @@ public async Task DeleteMediaAsync(string userId, string mediaId, CancellationTo /// Optional parameter: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000 /// Returns the ApiResponse response from the API call public async Task> GetMessagesAsync( - string userId, + string accountId, string messageId = null, string sourceTn = null, string destinationTn = null, @@ -502,12 +497,12 @@ public async Task DeleteMediaAsync(string userId, string mediaId, CancellationTo //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); - _queryBuilder.Append("/users/{userId}/messages"); + _queryBuilder.Append("/users/{accountId}/messages"); //process optional template parameters ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() { - { "userId", userId } + { "accountId", accountId } }); //prepare specfied query parameters @@ -552,32 +547,32 @@ public async Task DeleteMediaAsync(string userId, string mediaId, CancellationTo //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new MessagingException("400 Request is malformed or invalid", _context); + throw new MessagingExceptionErrorException("400 Request is malformed or invalid", _context); } if (_response.StatusCode == 401) { - throw new MessagingException("401 The specified user does not have access to the account", _context); + throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", _context); } if (_response.StatusCode == 403) { - throw new MessagingException("403 The user does not have access to this API", _context); + throw new MessagingExceptionErrorException("403 The user does not have access to this API", _context); } if (_response.StatusCode == 404) { - throw new MessagingException("404 Path not found", _context); + throw new MessagingExceptionErrorException("404 Path not found", _context); } if (_response.StatusCode == 415) { - throw new MessagingException("415 The content-type of the request is incorrect", _context); + throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", _context); } if (_response.StatusCode == 429) { - throw new MessagingException("429 The rate limit has been reached", _context); + throw new MessagingExceptionErrorException("429 The rate limit has been reached", _context); } //handle errors defined at the API level @@ -591,12 +586,12 @@ public async Task DeleteMediaAsync(string userId, string mediaId, CancellationTo /// /// createMessage /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Required parameter: Example: /// Returns the ApiResponse response from the API call - public ApiResponse CreateMessage(string userId, Models.MessageRequest body) + public ApiResponse CreateMessage(string accountId, Models.MessageRequest body) { - Task> t = CreateMessageAsync(userId, body); + Task> t = CreateMessageAsync(accountId, body); ApiHelper.RunTaskSynchronously(t); return t.Result; } @@ -604,22 +599,22 @@ public async Task DeleteMediaAsync(string userId, string mediaId, CancellationTo /// /// createMessage /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Required parameter: Example: /// Returns the ApiResponse response from the API call - public async Task> CreateMessageAsync(string userId, Models.MessageRequest body, CancellationToken cancellationToken = default) + public async Task> CreateMessageAsync(string accountId, Models.MessageRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(Server.MessagingDefault); //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); - _queryBuilder.Append("/users/{userId}/messages"); + _queryBuilder.Append("/users/{accountId}/messages"); //process optional template parameters ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() { - { "userId", userId } + { "accountId", accountId } }); //append request with appropriate headers and parameters @@ -654,32 +649,32 @@ public async Task DeleteMediaAsync(string userId, string mediaId, CancellationTo //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new MessagingException("400 Request is malformed or invalid", _context); + throw new MessagingExceptionErrorException("400 Request is malformed or invalid", _context); } if (_response.StatusCode == 401) { - throw new MessagingException("401 The specified user does not have access to the account", _context); + throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", _context); } if (_response.StatusCode == 403) { - throw new MessagingException("403 The user does not have access to this API", _context); + throw new MessagingExceptionErrorException("403 The user does not have access to this API", _context); } if (_response.StatusCode == 404) { - throw new MessagingException("404 Path not found", _context); + throw new MessagingExceptionErrorException("404 Path not found", _context); } if (_response.StatusCode == 415) { - throw new MessagingException("415 The content-type of the request is incorrect", _context); + throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", _context); } if (_response.StatusCode == 429) { - throw new MessagingException("429 The rate limit has been reached", _context); + throw new MessagingExceptionErrorException("429 The rate limit has been reached", _context); } //handle errors defined at the API level diff --git a/Bandwidth.Standard/Messaging/Exceptions/MessagingException.cs b/Bandwidth.Standard/Messaging/Exceptions/MessagingExceptionErrorException.cs similarity index 85% rename from Bandwidth.Standard/Messaging/Exceptions/MessagingException.cs rename to Bandwidth.Standard/Messaging/Exceptions/MessagingExceptionErrorException.cs index 9029053f..526d836e 100644 --- a/Bandwidth.Standard/Messaging/Exceptions/MessagingException.cs +++ b/Bandwidth.Standard/Messaging/Exceptions/MessagingExceptionErrorException.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -20,14 +21,14 @@ namespace Bandwidth.Standard.Messaging.Exceptions { - public class MessagingException : ApiException + public class MessagingExceptionErrorException : ApiException { /// /// Initialization constructor /// /// The reason for throwing exception /// The HTTP context that encapsulates request and response objects - public MessagingException(string reason, HttpContext context) + public MessagingExceptionErrorException(string reason, HttpContext context) : base(reason, context) { } /// diff --git a/Bandwidth.Standard/Messaging/Models/BandwidthCallbackMessage.cs b/Bandwidth.Standard/Messaging/Models/BandwidthCallbackMessage.cs index fef7900e..a59adc67 100644 --- a/Bandwidth.Standard/Messaging/Models/BandwidthCallbackMessage.cs +++ b/Bandwidth.Standard/Messaging/Models/BandwidthCallbackMessage.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -72,5 +73,82 @@ public BandwidthCallbackMessage(string time = null, [JsonProperty("message", NullValueHandling = NullValueHandling.Ignore)] public Models.BandwidthMessage Message { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"BandwidthCallbackMessage : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Time = {(Time == null ? "null" : Time == string.Empty ? "" : Time)}"); + toStringOutput.Add($"Type = {(Type == null ? "null" : Type == string.Empty ? "" : Type)}"); + toStringOutput.Add($"To = {(To == null ? "null" : To == string.Empty ? "" : To)}"); + toStringOutput.Add($"ErrorCode = {(ErrorCode == null ? "null" : ErrorCode == string.Empty ? "" : ErrorCode)}"); + toStringOutput.Add($"Description = {(Description == null ? "null" : Description == string.Empty ? "" : Description)}"); + toStringOutput.Add($"Message = {(Message == null ? "null" : Message.ToString())}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is BandwidthCallbackMessage other && + ((Time == null && other.Time == null) || (Time?.Equals(other.Time) == true)) && + ((Type == null && other.Type == null) || (Type?.Equals(other.Type) == true)) && + ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && + ((ErrorCode == null && other.ErrorCode == null) || (ErrorCode?.Equals(other.ErrorCode) == true)) && + ((Description == null && other.Description == null) || (Description?.Equals(other.Description) == true)) && + ((Message == null && other.Message == null) || (Message?.Equals(other.Message) == true)); + } + + public override int GetHashCode() + { + int hashCode = -419618432; + + if (Time != null) + { + hashCode += Time.GetHashCode(); + } + + if (Type != null) + { + hashCode += Type.GetHashCode(); + } + + if (To != null) + { + hashCode += To.GetHashCode(); + } + + if (ErrorCode != null) + { + hashCode += ErrorCode.GetHashCode(); + } + + if (Description != null) + { + hashCode += Description.GetHashCode(); + } + + if (Message != null) + { + hashCode += Message.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/BandwidthMessage.cs b/Bandwidth.Standard/Messaging/Models/BandwidthMessage.cs index 493afcf0..47307935 100644 --- a/Bandwidth.Standard/Messaging/Models/BandwidthMessage.cs +++ b/Bandwidth.Standard/Messaging/Models/BandwidthMessage.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -120,5 +121,124 @@ public BandwidthMessage(string id = null, [JsonProperty("priority", NullValueHandling = NullValueHandling.Ignore)] public string Priority { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"BandwidthMessage : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}"); + toStringOutput.Add($"Owner = {(Owner == null ? "null" : Owner == string.Empty ? "" : Owner)}"); + toStringOutput.Add($"ApplicationId = {(ApplicationId == null ? "null" : ApplicationId == string.Empty ? "" : ApplicationId)}"); + toStringOutput.Add($"Time = {(Time == null ? "null" : Time == string.Empty ? "" : Time)}"); + toStringOutput.Add($"SegmentCount = {(SegmentCount == null ? "null" : SegmentCount.ToString())}"); + toStringOutput.Add($"Direction = {(Direction == null ? "null" : Direction == string.Empty ? "" : Direction)}"); + toStringOutput.Add($"To = {(To == null ? "null" : $"[{ string.Join(", ", To)} ]")}"); + toStringOutput.Add($"From = {(From == null ? "null" : From == string.Empty ? "" : From)}"); + toStringOutput.Add($"Media = {(Media == null ? "null" : $"[{ string.Join(", ", Media)} ]")}"); + toStringOutput.Add($"Text = {(Text == null ? "null" : Text == string.Empty ? "" : Text)}"); + toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); + toStringOutput.Add($"Priority = {(Priority == null ? "null" : Priority == string.Empty ? "" : Priority)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is BandwidthMessage other && + ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) && + ((Owner == null && other.Owner == null) || (Owner?.Equals(other.Owner) == true)) && + ((ApplicationId == null && other.ApplicationId == null) || (ApplicationId?.Equals(other.ApplicationId) == true)) && + ((Time == null && other.Time == null) || (Time?.Equals(other.Time) == true)) && + ((SegmentCount == null && other.SegmentCount == null) || (SegmentCount?.Equals(other.SegmentCount) == true)) && + ((Direction == null && other.Direction == null) || (Direction?.Equals(other.Direction) == true)) && + ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && + ((From == null && other.From == null) || (From?.Equals(other.From) == true)) && + ((Media == null && other.Media == null) || (Media?.Equals(other.Media) == true)) && + ((Text == null && other.Text == null) || (Text?.Equals(other.Text) == true)) && + ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)) && + ((Priority == null && other.Priority == null) || (Priority?.Equals(other.Priority) == true)); + } + + public override int GetHashCode() + { + int hashCode = 1547980768; + + if (Id != null) + { + hashCode += Id.GetHashCode(); + } + + if (Owner != null) + { + hashCode += Owner.GetHashCode(); + } + + if (ApplicationId != null) + { + hashCode += ApplicationId.GetHashCode(); + } + + if (Time != null) + { + hashCode += Time.GetHashCode(); + } + + if (SegmentCount != null) + { + hashCode += SegmentCount.GetHashCode(); + } + + if (Direction != null) + { + hashCode += Direction.GetHashCode(); + } + + if (To != null) + { + hashCode += To.GetHashCode(); + } + + if (From != null) + { + hashCode += From.GetHashCode(); + } + + if (Media != null) + { + hashCode += Media.GetHashCode(); + } + + if (Text != null) + { + hashCode += Text.GetHashCode(); + } + + if (Tag != null) + { + hashCode += Tag.GetHashCode(); + } + + if (Priority != null) + { + hashCode += Priority.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/BandwidthMessageItem.cs b/Bandwidth.Standard/Messaging/Models/BandwidthMessageItem.cs index e104022e..441dcc35 100644 --- a/Bandwidth.Standard/Messaging/Models/BandwidthMessageItem.cs +++ b/Bandwidth.Standard/Messaging/Models/BandwidthMessageItem.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -112,5 +113,117 @@ public BandwidthMessageItem(string messageId = null, [JsonProperty("carrierName", NullValueHandling = NullValueHandling.Ignore)] public string CarrierName { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"BandwidthMessageItem : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"MessageId = {(MessageId == null ? "null" : MessageId == string.Empty ? "" : MessageId)}"); + toStringOutput.Add($"AccountId = {(AccountId == null ? "null" : AccountId == string.Empty ? "" : AccountId)}"); + toStringOutput.Add($"SourceTn = {(SourceTn == null ? "null" : SourceTn == string.Empty ? "" : SourceTn)}"); + toStringOutput.Add($"DestinationTn = {(DestinationTn == null ? "null" : DestinationTn == string.Empty ? "" : DestinationTn)}"); + toStringOutput.Add($"MessageStatus = {(MessageStatus == null ? "null" : MessageStatus == string.Empty ? "" : MessageStatus)}"); + toStringOutput.Add($"MessageDirection = {(MessageDirection == null ? "null" : MessageDirection == string.Empty ? "" : MessageDirection)}"); + toStringOutput.Add($"MessageType = {(MessageType == null ? "null" : MessageType == string.Empty ? "" : MessageType)}"); + toStringOutput.Add($"SegmentCount = {(SegmentCount == null ? "null" : SegmentCount.ToString())}"); + toStringOutput.Add($"ErrorCode = {(ErrorCode == null ? "null" : ErrorCode.ToString())}"); + toStringOutput.Add($"ReceiveTime = {(ReceiveTime == null ? "null" : ReceiveTime == string.Empty ? "" : ReceiveTime)}"); + toStringOutput.Add($"CarrierName = {(CarrierName == null ? "null" : CarrierName == string.Empty ? "" : CarrierName)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is BandwidthMessageItem other && + ((MessageId == null && other.MessageId == null) || (MessageId?.Equals(other.MessageId) == true)) && + ((AccountId == null && other.AccountId == null) || (AccountId?.Equals(other.AccountId) == true)) && + ((SourceTn == null && other.SourceTn == null) || (SourceTn?.Equals(other.SourceTn) == true)) && + ((DestinationTn == null && other.DestinationTn == null) || (DestinationTn?.Equals(other.DestinationTn) == true)) && + ((MessageStatus == null && other.MessageStatus == null) || (MessageStatus?.Equals(other.MessageStatus) == true)) && + ((MessageDirection == null && other.MessageDirection == null) || (MessageDirection?.Equals(other.MessageDirection) == true)) && + ((MessageType == null && other.MessageType == null) || (MessageType?.Equals(other.MessageType) == true)) && + ((SegmentCount == null && other.SegmentCount == null) || (SegmentCount?.Equals(other.SegmentCount) == true)) && + ((ErrorCode == null && other.ErrorCode == null) || (ErrorCode?.Equals(other.ErrorCode) == true)) && + ((ReceiveTime == null && other.ReceiveTime == null) || (ReceiveTime?.Equals(other.ReceiveTime) == true)) && + ((CarrierName == null && other.CarrierName == null) || (CarrierName?.Equals(other.CarrierName) == true)); + } + + public override int GetHashCode() + { + int hashCode = 498628859; + + if (MessageId != null) + { + hashCode += MessageId.GetHashCode(); + } + + if (AccountId != null) + { + hashCode += AccountId.GetHashCode(); + } + + if (SourceTn != null) + { + hashCode += SourceTn.GetHashCode(); + } + + if (DestinationTn != null) + { + hashCode += DestinationTn.GetHashCode(); + } + + if (MessageStatus != null) + { + hashCode += MessageStatus.GetHashCode(); + } + + if (MessageDirection != null) + { + hashCode += MessageDirection.GetHashCode(); + } + + if (MessageType != null) + { + hashCode += MessageType.GetHashCode(); + } + + if (SegmentCount != null) + { + hashCode += SegmentCount.GetHashCode(); + } + + if (ErrorCode != null) + { + hashCode += ErrorCode.GetHashCode(); + } + + if (ReceiveTime != null) + { + hashCode += ReceiveTime.GetHashCode(); + } + + if (CarrierName != null) + { + hashCode += CarrierName.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/BandwidthMessagesList.cs b/Bandwidth.Standard/Messaging/Models/BandwidthMessagesList.cs index 21a9ac4f..2a3a70d2 100644 --- a/Bandwidth.Standard/Messaging/Models/BandwidthMessagesList.cs +++ b/Bandwidth.Standard/Messaging/Models/BandwidthMessagesList.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -48,5 +49,61 @@ public BandwidthMessagesList(int? totalCount = null, [JsonProperty("messages", NullValueHandling = NullValueHandling.Ignore)] public List Messages { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"BandwidthMessagesList : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"TotalCount = {(TotalCount == null ? "null" : TotalCount.ToString())}"); + toStringOutput.Add($"PageInfo = {(PageInfo == null ? "null" : PageInfo.ToString())}"); + toStringOutput.Add($"Messages = {(Messages == null ? "null" : $"[{ string.Join(", ", Messages)} ]")}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is BandwidthMessagesList other && + ((TotalCount == null && other.TotalCount == null) || (TotalCount?.Equals(other.TotalCount) == true)) && + ((PageInfo == null && other.PageInfo == null) || (PageInfo?.Equals(other.PageInfo) == true)) && + ((Messages == null && other.Messages == null) || (Messages?.Equals(other.Messages) == true)); + } + + public override int GetHashCode() + { + int hashCode = 23261715; + + if (TotalCount != null) + { + hashCode += TotalCount.GetHashCode(); + } + + if (PageInfo != null) + { + hashCode += PageInfo.GetHashCode(); + } + + if (Messages != null) + { + hashCode += Messages.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/DeferredResult.cs b/Bandwidth.Standard/Messaging/Models/DeferredResult.cs index 4c1eaaf9..df801919 100644 --- a/Bandwidth.Standard/Messaging/Models/DeferredResult.cs +++ b/Bandwidth.Standard/Messaging/Models/DeferredResult.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -40,5 +41,54 @@ public DeferredResult(object result = null, [JsonProperty("setOrExpired", NullValueHandling = NullValueHandling.Ignore)] public bool? SetOrExpired { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"DeferredResult : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Result = {(Result == null ? "null" : Result.ToString())}"); + toStringOutput.Add($"SetOrExpired = {(SetOrExpired == null ? "null" : SetOrExpired.ToString())}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is DeferredResult other && + ((Result == null && other.Result == null) || (Result?.Equals(other.Result) == true)) && + ((SetOrExpired == null && other.SetOrExpired == null) || (SetOrExpired?.Equals(other.SetOrExpired) == true)); + } + + public override int GetHashCode() + { + int hashCode = -1571367651; + + if (Result != null) + { + hashCode += Result.GetHashCode(); + } + + if (SetOrExpired != null) + { + hashCode += SetOrExpired.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/Media.cs b/Bandwidth.Standard/Messaging/Models/Media.cs index 13cd55b9..a278f0ae 100644 --- a/Bandwidth.Standard/Messaging/Models/Media.cs +++ b/Bandwidth.Standard/Messaging/Models/Media.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -21,70 +22,26 @@ public class Media { public Media() { } - public Media(object inputStream = null, - string content = null, - string url = null, - string contentLength = null, - string contentType = null, - List tags = null, - string userId = null, - string mediaName = null, - string mediaId = null, - string cacheControl = null) + public Media(string content = null, + int? contentLength = null, + string mediaName = null) { - InputStream = inputStream; Content = content; - Url = url; ContentLength = contentLength; - ContentType = contentType; - Tags = tags; - UserId = userId; MediaName = mediaName; - MediaId = mediaId; - CacheControl = cacheControl; } - /// - /// Getter for inputStream - /// - [JsonProperty("inputStream", NullValueHandling = NullValueHandling.Ignore)] - public object InputStream { get; set; } - /// /// Getter for content /// [JsonProperty("content", NullValueHandling = NullValueHandling.Ignore)] public string Content { get; set; } - /// - /// Getter for url - /// - [JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)] - public string Url { get; set; } - /// /// Getter for contentLength /// [JsonProperty("contentLength", NullValueHandling = NullValueHandling.Ignore)] - public string ContentLength { get; set; } - - /// - /// Getter for contentType - /// - [JsonProperty("contentType", NullValueHandling = NullValueHandling.Ignore)] - public string ContentType { get; set; } - - /// - /// Getter for tags - /// - [JsonProperty("tags", NullValueHandling = NullValueHandling.Ignore)] - public List Tags { get; set; } - - /// - /// User's account ID - /// - [JsonProperty("userId", NullValueHandling = NullValueHandling.Ignore)] - public string UserId { get; set; } + public int? ContentLength { get; set; } /// /// Getter for mediaName @@ -92,17 +49,61 @@ public Media(object inputStream = null, [JsonProperty("mediaName", NullValueHandling = NullValueHandling.Ignore)] public string MediaName { get; set; } - /// - /// Getter for mediaId - /// - [JsonProperty("mediaId", NullValueHandling = NullValueHandling.Ignore)] - public string MediaId { get; set; } + public override string ToString() + { + var toStringOutput = new List(); - /// - /// Getter for cacheControl - /// - [JsonProperty("cacheControl", NullValueHandling = NullValueHandling.Ignore)] - public string CacheControl { get; set; } + this.ToString(toStringOutput); + + return $"Media : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Content = {(Content == null ? "null" : Content == string.Empty ? "" : Content)}"); + toStringOutput.Add($"ContentLength = {(ContentLength == null ? "null" : ContentLength.ToString())}"); + toStringOutput.Add($"MediaName = {(MediaName == null ? "null" : MediaName == string.Empty ? "" : MediaName)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is Media other && + ((Content == null && other.Content == null) || (Content?.Equals(other.Content) == true)) && + ((ContentLength == null && other.ContentLength == null) || (ContentLength?.Equals(other.ContentLength) == true)) && + ((MediaName == null && other.MediaName == null) || (MediaName?.Equals(other.MediaName) == true)); + } + + public override int GetHashCode() + { + int hashCode = 457305241; + + if (Content != null) + { + hashCode += Content.GetHashCode(); + } + + if (ContentLength != null) + { + hashCode += ContentLength.GetHashCode(); + } + + if (MediaName != null) + { + hashCode += MediaName.GetHashCode(); + } + + return hashCode; + } } } \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/MessageRequest.cs b/Bandwidth.Standard/Messaging/Models/MessageRequest.cs index 2b41cc05..6afada4d 100644 --- a/Bandwidth.Standard/Messaging/Models/MessageRequest.cs +++ b/Bandwidth.Standard/Messaging/Models/MessageRequest.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -80,5 +81,89 @@ public MessageRequest(string applicationId, [JsonProperty("priority", ItemConverterType = typeof(StringValuedEnumConverter), NullValueHandling = NullValueHandling.Ignore)] public Models.PriorityEnum? Priority { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"MessageRequest : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"ApplicationId = {(ApplicationId == null ? "null" : ApplicationId == string.Empty ? "" : ApplicationId)}"); + toStringOutput.Add($"To = {(To == null ? "null" : $"[{ string.Join(", ", To)} ]")}"); + toStringOutput.Add($"From = {(From == null ? "null" : From == string.Empty ? "" : From)}"); + toStringOutput.Add($"Text = {(Text == null ? "null" : Text == string.Empty ? "" : Text)}"); + toStringOutput.Add($"Media = {(Media == null ? "null" : $"[{ string.Join(", ", Media)} ]")}"); + toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); + toStringOutput.Add($"Priority = {(Priority == null ? "null" : Priority.ToString())}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is MessageRequest other && + ((ApplicationId == null && other.ApplicationId == null) || (ApplicationId?.Equals(other.ApplicationId) == true)) && + ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && + ((From == null && other.From == null) || (From?.Equals(other.From) == true)) && + ((Text == null && other.Text == null) || (Text?.Equals(other.Text) == true)) && + ((Media == null && other.Media == null) || (Media?.Equals(other.Media) == true)) && + ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)) && + ((Priority == null && other.Priority == null) || (Priority?.Equals(other.Priority) == true)); + } + + public override int GetHashCode() + { + int hashCode = -287486185; + + if (ApplicationId != null) + { + hashCode += ApplicationId.GetHashCode(); + } + + if (To != null) + { + hashCode += To.GetHashCode(); + } + + if (From != null) + { + hashCode += From.GetHashCode(); + } + + if (Text != null) + { + hashCode += Text.GetHashCode(); + } + + if (Media != null) + { + hashCode += Media.GetHashCode(); + } + + if (Tag != null) + { + hashCode += Tag.GetHashCode(); + } + + if (Priority != null) + { + hashCode += Priority.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/MessagingException.cs b/Bandwidth.Standard/Messaging/Models/MessagingException.cs new file mode 100644 index 00000000..61f8ce51 --- /dev/null +++ b/Bandwidth.Standard/Messaging/Models/MessagingException.cs @@ -0,0 +1,94 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.Messaging.Models +{ + public class MessagingException + { + public MessagingException() { } + + public MessagingException(string type, + string description) + { + Type = type; + Description = description; + } + + /// + /// Getter for type + /// + [JsonProperty("type")] + public string Type { get; set; } + + /// + /// Getter for description + /// + [JsonProperty("description")] + public string Description { get; set; } + + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"MessagingException : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Type = {(Type == null ? "null" : Type == string.Empty ? "" : Type)}"); + toStringOutput.Add($"Description = {(Description == null ? "null" : Description == string.Empty ? "" : Description)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is MessagingException other && + ((Type == null && other.Type == null) || (Type?.Equals(other.Type) == true)) && + ((Description == null && other.Description == null) || (Description?.Equals(other.Description) == true)); + } + + public override int GetHashCode() + { + int hashCode = -855072673; + + if (Type != null) + { + hashCode += Type.GetHashCode(); + } + + if (Description != null) + { + hashCode += Description.GetHashCode(); + } + + return hashCode; + } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/PageInfo.cs b/Bandwidth.Standard/Messaging/Models/PageInfo.cs index febffc5d..f0a33281 100644 --- a/Bandwidth.Standard/Messaging/Models/PageInfo.cs +++ b/Bandwidth.Standard/Messaging/Models/PageInfo.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -56,5 +57,68 @@ public PageInfo(string prevPage = null, [JsonProperty("nextPageToken", NullValueHandling = NullValueHandling.Ignore)] public string NextPageToken { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"PageInfo : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"PrevPage = {(PrevPage == null ? "null" : PrevPage == string.Empty ? "" : PrevPage)}"); + toStringOutput.Add($"NextPage = {(NextPage == null ? "null" : NextPage == string.Empty ? "" : NextPage)}"); + toStringOutput.Add($"PrevPageToken = {(PrevPageToken == null ? "null" : PrevPageToken == string.Empty ? "" : PrevPageToken)}"); + toStringOutput.Add($"NextPageToken = {(NextPageToken == null ? "null" : NextPageToken == string.Empty ? "" : NextPageToken)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is PageInfo other && + ((PrevPage == null && other.PrevPage == null) || (PrevPage?.Equals(other.PrevPage) == true)) && + ((NextPage == null && other.NextPage == null) || (NextPage?.Equals(other.NextPage) == true)) && + ((PrevPageToken == null && other.PrevPageToken == null) || (PrevPageToken?.Equals(other.PrevPageToken) == true)) && + ((NextPageToken == null && other.NextPageToken == null) || (NextPageToken?.Equals(other.NextPageToken) == true)); + } + + public override int GetHashCode() + { + int hashCode = -1830408517; + + if (PrevPage != null) + { + hashCode += PrevPage.GetHashCode(); + } + + if (NextPage != null) + { + hashCode += NextPage.GetHashCode(); + } + + if (PrevPageToken != null) + { + hashCode += PrevPageToken.GetHashCode(); + } + + if (NextPageToken != null) + { + hashCode += NextPageToken.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/Tag.cs b/Bandwidth.Standard/Messaging/Models/Tag.cs index 00f07dbd..9e0bd20b 100644 --- a/Bandwidth.Standard/Messaging/Models/Tag.cs +++ b/Bandwidth.Standard/Messaging/Models/Tag.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -40,5 +41,54 @@ public Tag(string key = null, [JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)] public string MValue { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"Tag : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Key = {(Key == null ? "null" : Key == string.Empty ? "" : Key)}"); + toStringOutput.Add($"MValue = {(MValue == null ? "null" : MValue == string.Empty ? "" : MValue)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is Tag other && + ((Key == null && other.Key == null) || (Key?.Equals(other.Key) == true)) && + ((MValue == null && other.MValue == null) || (MValue?.Equals(other.MValue) == true)); + } + + public override int GetHashCode() + { + int hashCode = -458578094; + + if (Key != null) + { + hashCode += Key.GetHashCode(); + } + + if (MValue != null) + { + hashCode += MValue.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/TwoFactorAuth/Controllers/MFAController.cs b/Bandwidth.Standard/MultiFactorAuth/Controllers/MFAController.cs similarity index 82% rename from Bandwidth.Standard/TwoFactorAuth/Controllers/MFAController.cs rename to Bandwidth.Standard/MultiFactorAuth/Controllers/MFAController.cs index 1ba8b026..00a54c87 100644 --- a/Bandwidth.Standard/TwoFactorAuth/Controllers/MFAController.cs +++ b/Bandwidth.Standard/MultiFactorAuth/Controllers/MFAController.cs @@ -19,9 +19,9 @@ using Bandwidth.Standard.Http.Response; using Bandwidth.Standard.Http.Client; using Bandwidth.Standard.Authentication; -using Bandwidth.Standard.TwoFactorAuth.Exceptions; +using Bandwidth.Standard.MultiFactorAuth.Exceptions; -namespace Bandwidth.Standard.TwoFactorAuth.Controllers +namespace Bandwidth.Standard.MultiFactorAuth.Controllers { public class MFAController : BaseController { @@ -51,7 +51,7 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar public async Task> CreateVoiceTwoFactorAsync(string accountId, Models.TwoFactorCodeRequestSchema body, CancellationToken cancellationToken = default) { //the base uri for api requests - string _baseUri = config.GetBaseUri(Server.TwoFactorAuthDefault); + string _baseUri = config.GetBaseUri(Server.MultiFactorAuthDefault); //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); @@ -81,7 +81,7 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = await authManagers["twoFactorAuth"].ApplyAsync(_request).ConfigureAwait(false); + _request = await authManagers["multiFactorAuth"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); @@ -95,22 +95,22 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ErrorWithRequestException("If there is any issue with values passed in by the user", _context); + throw new ErrorWithRequestErrorException("If there is any issue with values passed in by the user", _context); } if (_response.StatusCode == 401) { - throw new UnauthorizedRequestException("Authentication is either incorrect or not present", _context); + throw new UnauthorizedRequestErrorException("Authentication is either incorrect or not present", _context); } if (_response.StatusCode == 403) { - throw new ForbiddenRequestException("The user is not authorized to access this resource", _context); + throw new ForbiddenRequestErrorException("The user is not authorized to access this resource", _context); } if (_response.StatusCode == 500) { - throw new ErrorWithRequestException("An internal server error occurred", _context); + throw new ErrorWithRequestErrorException("An internal server error occurred", _context); } //handle errors defined at the API level @@ -143,7 +143,7 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar public async Task> CreateMessagingTwoFactorAsync(string accountId, Models.TwoFactorCodeRequestSchema body, CancellationToken cancellationToken = default) { //the base uri for api requests - string _baseUri = config.GetBaseUri(Server.TwoFactorAuthDefault); + string _baseUri = config.GetBaseUri(Server.MultiFactorAuthDefault); //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); @@ -173,7 +173,7 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = await authManagers["twoFactorAuth"].ApplyAsync(_request).ConfigureAwait(false); + _request = await authManagers["multiFactorAuth"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); @@ -187,22 +187,22 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ErrorWithRequestException("If there is any issue with values passed in by the user", _context); + throw new ErrorWithRequestErrorException("If there is any issue with values passed in by the user", _context); } if (_response.StatusCode == 401) { - throw new UnauthorizedRequestException("Authentication is either incorrect or not present", _context); + throw new UnauthorizedRequestErrorException("Authentication is either incorrect or not present", _context); } if (_response.StatusCode == 403) { - throw new ForbiddenRequestException("The user is not authorized to access this resource", _context); + throw new ForbiddenRequestErrorException("The user is not authorized to access this resource", _context); } if (_response.StatusCode == 500) { - throw new ErrorWithRequestException("An internal server error occurred", _context); + throw new ErrorWithRequestErrorException("An internal server error occurred", _context); } //handle errors defined at the API level @@ -235,7 +235,7 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar public async Task> CreateVerifyTwoFactorAsync(string accountId, Models.TwoFactorVerifyRequestSchema body, CancellationToken cancellationToken = default) { //the base uri for api requests - string _baseUri = config.GetBaseUri(Server.TwoFactorAuthDefault); + string _baseUri = config.GetBaseUri(Server.MultiFactorAuthDefault); //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); @@ -265,7 +265,7 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = await authManagers["twoFactorAuth"].ApplyAsync(_request).ConfigureAwait(false); + _request = await authManagers["multiFactorAuth"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); @@ -279,27 +279,27 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ErrorWithRequestException("If there is any issue with values passed in by the user", _context); + throw new ErrorWithRequestErrorException("If there is any issue with values passed in by the user", _context); } if (_response.StatusCode == 401) { - throw new UnauthorizedRequestException("Authentication is either incorrect or not present", _context); + throw new UnauthorizedRequestErrorException("Authentication is either incorrect or not present", _context); } if (_response.StatusCode == 403) { - throw new ForbiddenRequestException("The user is not authorized to access this resource", _context); + throw new ForbiddenRequestErrorException("The user is not authorized to access this resource", _context); } if (_response.StatusCode == 429) { - throw new ErrorWithRequestException("The user has made too many bad requests and is temporarily locked out", _context); + throw new ErrorWithRequestErrorException("The user has made too many bad requests and is temporarily locked out", _context); } if (_response.StatusCode == 500) { - throw new ErrorWithRequestException("An internal server error occurred", _context); + throw new ErrorWithRequestErrorException("An internal server error occurred", _context); } //handle errors defined at the API level diff --git a/Bandwidth.Standard/TwoFactorAuth/Exceptions/ErrorWithRequestException.cs b/Bandwidth.Standard/MultiFactorAuth/Exceptions/ErrorWithRequestErrorException.cs similarity index 80% rename from Bandwidth.Standard/TwoFactorAuth/Exceptions/ErrorWithRequestException.cs rename to Bandwidth.Standard/MultiFactorAuth/Exceptions/ErrorWithRequestErrorException.cs index ce262735..36a59358 100644 --- a/Bandwidth.Standard/TwoFactorAuth/Exceptions/ErrorWithRequestException.cs +++ b/Bandwidth.Standard/MultiFactorAuth/Exceptions/ErrorWithRequestErrorException.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -14,20 +15,20 @@ using Newtonsoft.Json.Converters; using Bandwidth.Standard.Http.Client; using Bandwidth.Standard.Exceptions; -using Bandwidth.Standard.TwoFactorAuth.Models; +using Bandwidth.Standard.MultiFactorAuth.Models; using Bandwidth.Standard; using Bandwidth.Standard.Utilities; -namespace Bandwidth.Standard.TwoFactorAuth.Exceptions +namespace Bandwidth.Standard.MultiFactorAuth.Exceptions { - public class ErrorWithRequestException : ApiException + public class ErrorWithRequestErrorException : ApiException { /// /// Initialization constructor /// /// The reason for throwing exception /// The HTTP context that encapsulates request and response objects - public ErrorWithRequestException(string reason, HttpContext context) + public ErrorWithRequestErrorException(string reason, HttpContext context) : base(reason, context) { } /// diff --git a/Bandwidth.Standard/TwoFactorAuth/Exceptions/ForbiddenRequestException.cs b/Bandwidth.Standard/MultiFactorAuth/Exceptions/ForbiddenRequestErrorException.cs similarity index 78% rename from Bandwidth.Standard/TwoFactorAuth/Exceptions/ForbiddenRequestException.cs rename to Bandwidth.Standard/MultiFactorAuth/Exceptions/ForbiddenRequestErrorException.cs index 11217a36..05f2bc02 100644 --- a/Bandwidth.Standard/TwoFactorAuth/Exceptions/ForbiddenRequestException.cs +++ b/Bandwidth.Standard/MultiFactorAuth/Exceptions/ForbiddenRequestErrorException.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -14,20 +15,20 @@ using Newtonsoft.Json.Converters; using Bandwidth.Standard.Http.Client; using Bandwidth.Standard.Exceptions; -using Bandwidth.Standard.TwoFactorAuth.Models; +using Bandwidth.Standard.MultiFactorAuth.Models; using Bandwidth.Standard; using Bandwidth.Standard.Utilities; -namespace Bandwidth.Standard.TwoFactorAuth.Exceptions +namespace Bandwidth.Standard.MultiFactorAuth.Exceptions { - public class ForbiddenRequestException : ApiException + public class ForbiddenRequestErrorException : ApiException { /// /// Initialization constructor /// /// The reason for throwing exception /// The HTTP context that encapsulates request and response objects - public ForbiddenRequestException(string reason, HttpContext context) + public ForbiddenRequestErrorException(string reason, HttpContext context) : base(reason, context) { } /// diff --git a/Bandwidth.Standard/TwoFactorAuth/Exceptions/UnauthorizedRequestException.cs b/Bandwidth.Standard/MultiFactorAuth/Exceptions/UnauthorizedRequestErrorException.cs similarity index 77% rename from Bandwidth.Standard/TwoFactorAuth/Exceptions/UnauthorizedRequestException.cs rename to Bandwidth.Standard/MultiFactorAuth/Exceptions/UnauthorizedRequestErrorException.cs index 79293467..4f80f4d9 100644 --- a/Bandwidth.Standard/TwoFactorAuth/Exceptions/UnauthorizedRequestException.cs +++ b/Bandwidth.Standard/MultiFactorAuth/Exceptions/UnauthorizedRequestErrorException.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -14,20 +15,20 @@ using Newtonsoft.Json.Converters; using Bandwidth.Standard.Http.Client; using Bandwidth.Standard.Exceptions; -using Bandwidth.Standard.TwoFactorAuth.Models; +using Bandwidth.Standard.MultiFactorAuth.Models; using Bandwidth.Standard; using Bandwidth.Standard.Utilities; -namespace Bandwidth.Standard.TwoFactorAuth.Exceptions +namespace Bandwidth.Standard.MultiFactorAuth.Exceptions { - public class UnauthorizedRequestException : ApiException + public class UnauthorizedRequestErrorException : ApiException { /// /// Initialization constructor /// /// The reason for throwing exception /// The HTTP context that encapsulates request and response objects - public UnauthorizedRequestException(string reason, HttpContext context) + public UnauthorizedRequestErrorException(string reason, HttpContext context) : base(reason, context) { } /// diff --git a/Bandwidth.Standard/MultiFactorAuth/Models/ErrorWithRequest.cs b/Bandwidth.Standard/MultiFactorAuth/Models/ErrorWithRequest.cs new file mode 100644 index 00000000..72c57755 --- /dev/null +++ b/Bandwidth.Standard/MultiFactorAuth/Models/ErrorWithRequest.cs @@ -0,0 +1,94 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.MultiFactorAuth.Models +{ + public class ErrorWithRequest + { + public ErrorWithRequest() { } + + public ErrorWithRequest(string error = null, + string requestId = null) + { + Error = error; + RequestId = requestId; + } + + /// + /// An error message pertaining to what the issue could be + /// + [JsonProperty("error", NullValueHandling = NullValueHandling.Ignore)] + public string Error { get; set; } + + /// + /// The associated requestId from AWS + /// + [JsonProperty("requestId", NullValueHandling = NullValueHandling.Ignore)] + public string RequestId { get; set; } + + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"ErrorWithRequest : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Error = {(Error == null ? "null" : Error == string.Empty ? "" : Error)}"); + toStringOutput.Add($"RequestId = {(RequestId == null ? "null" : RequestId == string.Empty ? "" : RequestId)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is ErrorWithRequest other && + ((Error == null && other.Error == null) || (Error?.Equals(other.Error) == true)) && + ((RequestId == null && other.RequestId == null) || (RequestId?.Equals(other.RequestId) == true)); + } + + public override int GetHashCode() + { + int hashCode = -1751201851; + + if (Error != null) + { + hashCode += Error.GetHashCode(); + } + + if (RequestId != null) + { + hashCode += RequestId.GetHashCode(); + } + + return hashCode; + } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/MultiFactorAuth/Models/ForbiddenRequest.cs b/Bandwidth.Standard/MultiFactorAuth/Models/ForbiddenRequest.cs new file mode 100644 index 00000000..fff7124e --- /dev/null +++ b/Bandwidth.Standard/MultiFactorAuth/Models/ForbiddenRequest.cs @@ -0,0 +1,79 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.MultiFactorAuth.Models +{ + public class ForbiddenRequest + { + public ForbiddenRequest() { } + + public ForbiddenRequest(string message = null) + { + Message = message; + } + + /// + /// The message containing the reason behind the request being forbidden + /// + [JsonProperty("Message", NullValueHandling = NullValueHandling.Ignore)] + public string Message { get; set; } + + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"ForbiddenRequest : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Message = {(Message == null ? "null" : Message == string.Empty ? "" : Message)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is ForbiddenRequest other && + ((Message == null && other.Message == null) || (Message?.Equals(other.Message) == true)); + } + + public override int GetHashCode() + { + int hashCode = -1832523942; + + if (Message != null) + { + hashCode += Message.GetHashCode(); + } + + return hashCode; + } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorCodeRequestSchema.cs b/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorCodeRequestSchema.cs new file mode 100644 index 00000000..444acba7 --- /dev/null +++ b/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorCodeRequestSchema.cs @@ -0,0 +1,150 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.MultiFactorAuth.Models +{ + public class TwoFactorCodeRequestSchema + { + public TwoFactorCodeRequestSchema() { } + + public TwoFactorCodeRequestSchema(string to, + string from, + string applicationId, + string message, + double digits, + string scope = null) + { + To = to; + From = from; + ApplicationId = applicationId; + Scope = scope; + Message = message; + Digits = digits; + } + + /// + /// The phone number to send the 2fa code to. + /// + [JsonProperty("to")] + public string To { get; set; } + + /// + /// The application phone number, the sender of the 2fa code. + /// + [JsonProperty("from")] + public string From { get; set; } + + /// + /// The application unique ID, obtained from Bandwidth. + /// + [JsonProperty("applicationId")] + public string ApplicationId { get; set; } + + /// + /// An optional field to denote what scope or action the 2fa code is addressing. If not supplied, defaults to "2FA". + /// + [JsonProperty("scope", NullValueHandling = NullValueHandling.Ignore)] + public string Scope { get; set; } + + /// + /// The message format of the 2fa code. There are three values that the system will replace "{CODE}", "{NAME}", "{SCOPE}". The "{SCOPE}" and "{NAME} value template are optional, while "{CODE}" must be supplied. As the name would suggest, code will be replace with the actual 2fa code. Name is replaced with the application name, configured during provisioning of 2fa. The scope value is the same value sent during the call and partitioned by the server. + /// + [JsonProperty("message")] + public string Message { get; set; } + + /// + /// The number of digits for your 2fa code. The valid number ranges from 2 to 8, inclusively. + /// + [JsonProperty("digits")] + public double Digits { get; set; } + + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"TwoFactorCodeRequestSchema : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"To = {(To == null ? "null" : To == string.Empty ? "" : To)}"); + toStringOutput.Add($"From = {(From == null ? "null" : From == string.Empty ? "" : From)}"); + toStringOutput.Add($"ApplicationId = {(ApplicationId == null ? "null" : ApplicationId == string.Empty ? "" : ApplicationId)}"); + toStringOutput.Add($"Scope = {(Scope == null ? "null" : Scope == string.Empty ? "" : Scope)}"); + toStringOutput.Add($"Message = {(Message == null ? "null" : Message == string.Empty ? "" : Message)}"); + toStringOutput.Add($"Digits = {Digits}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is TwoFactorCodeRequestSchema other && + ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && + ((From == null && other.From == null) || (From?.Equals(other.From) == true)) && + ((ApplicationId == null && other.ApplicationId == null) || (ApplicationId?.Equals(other.ApplicationId) == true)) && + ((Scope == null && other.Scope == null) || (Scope?.Equals(other.Scope) == true)) && + ((Message == null && other.Message == null) || (Message?.Equals(other.Message) == true)) && + Digits.Equals(other.Digits); + } + + public override int GetHashCode() + { + int hashCode = -1960364933; + + if (To != null) + { + hashCode += To.GetHashCode(); + } + + if (From != null) + { + hashCode += From.GetHashCode(); + } + + if (ApplicationId != null) + { + hashCode += ApplicationId.GetHashCode(); + } + + if (Scope != null) + { + hashCode += Scope.GetHashCode(); + } + + if (Message != null) + { + hashCode += Message.GetHashCode(); + } + hashCode += Digits.GetHashCode(); + + return hashCode; + } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorMessagingResponse.cs b/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorMessagingResponse.cs new file mode 100644 index 00000000..967a56c2 --- /dev/null +++ b/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorMessagingResponse.cs @@ -0,0 +1,79 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.MultiFactorAuth.Models +{ + public class TwoFactorMessagingResponse + { + public TwoFactorMessagingResponse() { } + + public TwoFactorMessagingResponse(string messageId = null) + { + MessageId = messageId; + } + + /// + /// Getter for messageId + /// + [JsonProperty("messageId", NullValueHandling = NullValueHandling.Ignore)] + public string MessageId { get; set; } + + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"TwoFactorMessagingResponse : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"MessageId = {(MessageId == null ? "null" : MessageId == string.Empty ? "" : MessageId)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is TwoFactorMessagingResponse other && + ((MessageId == null && other.MessageId == null) || (MessageId?.Equals(other.MessageId) == true)); + } + + public override int GetHashCode() + { + int hashCode = 1575158831; + + if (MessageId != null) + { + hashCode += MessageId.GetHashCode(); + } + + return hashCode; + } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVerifyCodeResponse.cs b/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVerifyCodeResponse.cs new file mode 100644 index 00000000..558a1fe1 --- /dev/null +++ b/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVerifyCodeResponse.cs @@ -0,0 +1,79 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.MultiFactorAuth.Models +{ + public class TwoFactorVerifyCodeResponse + { + public TwoFactorVerifyCodeResponse() { } + + public TwoFactorVerifyCodeResponse(bool? valid = null) + { + Valid = valid; + } + + /// + /// Getter for valid + /// + [JsonProperty("valid", NullValueHandling = NullValueHandling.Ignore)] + public bool? Valid { get; set; } + + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"TwoFactorVerifyCodeResponse : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Valid = {(Valid == null ? "null" : Valid.ToString())}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is TwoFactorVerifyCodeResponse other && + ((Valid == null && other.Valid == null) || (Valid?.Equals(other.Valid) == true)); + } + + public override int GetHashCode() + { + int hashCode = 1979617985; + + if (Valid != null) + { + hashCode += Valid.GetHashCode(); + } + + return hashCode; + } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVerifyRequestSchema.cs b/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVerifyRequestSchema.cs new file mode 100644 index 00000000..90b5c307 --- /dev/null +++ b/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVerifyRequestSchema.cs @@ -0,0 +1,135 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.MultiFactorAuth.Models +{ + public class TwoFactorVerifyRequestSchema + { + public TwoFactorVerifyRequestSchema() { } + + public TwoFactorVerifyRequestSchema(string to, + string applicationId, + double expirationTimeInMinutes, + string code, + string scope = null) + { + To = to; + ApplicationId = applicationId; + Scope = scope; + ExpirationTimeInMinutes = expirationTimeInMinutes; + Code = code; + } + + /// + /// The phone number to send the 2fa code to. + /// + [JsonProperty("to")] + public string To { get; set; } + + /// + /// The application unique ID, obtained from Bandwidth. + /// + [JsonProperty("applicationId")] + public string ApplicationId { get; set; } + + /// + /// An optional field to denote what scope or action the 2fa code is addressing. If not supplied, defaults to "2FA". + /// + [JsonProperty("scope", NullValueHandling = NullValueHandling.Ignore)] + public string Scope { get; set; } + + /// + /// The time period, in minutes, to validate the 2fa code. By setting this to 3 minutes, it will mean any code generated within the last 3 minutes are still valid. The valid range for expiration time is between 0 and 15 minutes, exclusively and inclusively, respectively. + /// + [JsonProperty("expirationTimeInMinutes")] + public double ExpirationTimeInMinutes { get; set; } + + /// + /// The generated 2fa code to check if valid + /// + [JsonProperty("code")] + public string Code { get; set; } + + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"TwoFactorVerifyRequestSchema : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"To = {(To == null ? "null" : To == string.Empty ? "" : To)}"); + toStringOutput.Add($"ApplicationId = {(ApplicationId == null ? "null" : ApplicationId == string.Empty ? "" : ApplicationId)}"); + toStringOutput.Add($"Scope = {(Scope == null ? "null" : Scope == string.Empty ? "" : Scope)}"); + toStringOutput.Add($"ExpirationTimeInMinutes = {ExpirationTimeInMinutes}"); + toStringOutput.Add($"Code = {(Code == null ? "null" : Code == string.Empty ? "" : Code)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is TwoFactorVerifyRequestSchema other && + ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && + ((ApplicationId == null && other.ApplicationId == null) || (ApplicationId?.Equals(other.ApplicationId) == true)) && + ((Scope == null && other.Scope == null) || (Scope?.Equals(other.Scope) == true)) && + ExpirationTimeInMinutes.Equals(other.ExpirationTimeInMinutes) && + ((Code == null && other.Code == null) || (Code?.Equals(other.Code) == true)); + } + + public override int GetHashCode() + { + int hashCode = -2106512680; + + if (To != null) + { + hashCode += To.GetHashCode(); + } + + if (ApplicationId != null) + { + hashCode += ApplicationId.GetHashCode(); + } + + if (Scope != null) + { + hashCode += Scope.GetHashCode(); + } + hashCode += ExpirationTimeInMinutes.GetHashCode(); + + if (Code != null) + { + hashCode += Code.GetHashCode(); + } + + return hashCode; + } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVoiceResponse.cs b/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVoiceResponse.cs new file mode 100644 index 00000000..cba56aa5 --- /dev/null +++ b/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVoiceResponse.cs @@ -0,0 +1,79 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.MultiFactorAuth.Models +{ + public class TwoFactorVoiceResponse + { + public TwoFactorVoiceResponse() { } + + public TwoFactorVoiceResponse(string callId = null) + { + CallId = callId; + } + + /// + /// Getter for callId + /// + [JsonProperty("callId", NullValueHandling = NullValueHandling.Ignore)] + public string CallId { get; set; } + + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"TwoFactorVoiceResponse : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"CallId = {(CallId == null ? "null" : CallId == string.Empty ? "" : CallId)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is TwoFactorVoiceResponse other && + ((CallId == null && other.CallId == null) || (CallId?.Equals(other.CallId) == true)); + } + + public override int GetHashCode() + { + int hashCode = 1475004682; + + if (CallId != null) + { + hashCode += CallId.GetHashCode(); + } + + return hashCode; + } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/MultiFactorAuth/Models/UnauthorizedRequest.cs b/Bandwidth.Standard/MultiFactorAuth/Models/UnauthorizedRequest.cs new file mode 100644 index 00000000..f1643a8d --- /dev/null +++ b/Bandwidth.Standard/MultiFactorAuth/Models/UnauthorizedRequest.cs @@ -0,0 +1,79 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.MultiFactorAuth.Models +{ + public class UnauthorizedRequest + { + public UnauthorizedRequest() { } + + public UnauthorizedRequest(string message = null) + { + Message = message; + } + + /// + /// The message containing the reason behind the request being unauthorized + /// + [JsonProperty("message", NullValueHandling = NullValueHandling.Ignore)] + public string Message { get; set; } + + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"UnauthorizedRequest : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Message = {(Message == null ? "null" : Message == string.Empty ? "" : Message)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is UnauthorizedRequest other && + ((Message == null && other.Message == null) || (Message?.Equals(other.Message) == true)); + } + + public override int GetHashCode() + { + int hashCode = 448320439; + + if (Message != null) + { + hashCode += Message.GetHashCode(); + } + + return hashCode; + } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/TwoFactorAuth/TwoFactorAuthClient.cs b/Bandwidth.Standard/MultiFactorAuth/MultiFactorAuthClient.cs similarity index 78% rename from Bandwidth.Standard/TwoFactorAuth/TwoFactorAuthClient.cs rename to Bandwidth.Standard/MultiFactorAuth/MultiFactorAuthClient.cs index 9244c69d..67d283c2 100644 --- a/Bandwidth.Standard/TwoFactorAuth/TwoFactorAuthClient.cs +++ b/Bandwidth.Standard/MultiFactorAuth/MultiFactorAuthClient.cs @@ -4,11 +4,11 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ using System; -using Bandwidth.Standard.TwoFactorAuth.Controllers; +using Bandwidth.Standard.MultiFactorAuth.Controllers; -namespace Bandwidth.Standard.TwoFactorAuth +namespace Bandwidth.Standard.MultiFactorAuth { - public sealed class TwoFactorAuthClient + public sealed class MultiFactorAuthClient { private readonly BandwidthClient bandwidthClient; private readonly Lazy mFA; @@ -22,7 +22,7 @@ public sealed class TwoFactorAuthClient /// /// Default constructor /// - public TwoFactorAuthClient(BandwidthClient bandwidthClient) + public MultiFactorAuthClient(BandwidthClient bandwidthClient) { this.bandwidthClient = bandwidthClient; mFA = new Lazy( diff --git a/Bandwidth.Standard/Server.cs b/Bandwidth.Standard/Server.cs index d24875bc..97212abe 100644 --- a/Bandwidth.Standard/Server.cs +++ b/Bandwidth.Standard/Server.cs @@ -8,7 +8,7 @@ public enum Server { Default, MessagingDefault, - TwoFactorAuthDefault, + MultiFactorAuthDefault, VoiceDefault, WebRtcDefault, } diff --git a/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorCodeRequestSchema.cs b/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorCodeRequestSchema.cs deleted file mode 100644 index dd092bca..00000000 --- a/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorCodeRequestSchema.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.TwoFactorAuth.Models -{ - public class TwoFactorCodeRequestSchema - { - public TwoFactorCodeRequestSchema() { } - - public TwoFactorCodeRequestSchema(string to, - string from, - string applicationId, - string message, - double digits, - string scope = null) - { - To = to; - From = from; - ApplicationId = applicationId; - Scope = scope; - Message = message; - Digits = digits; - } - - /// - /// The phone number to send the 2fa code to. - /// - [JsonProperty("to")] - public string To { get; set; } - - /// - /// The application phone number, the sender of the 2fa code. - /// - [JsonProperty("from")] - public string From { get; set; } - - /// - /// The application unique ID, obtained from Bandwidth. - /// - [JsonProperty("applicationId")] - public string ApplicationId { get; set; } - - /// - /// An optional field to denote what scope or action the 2fa code is addressing. If not supplied, defaults to "2FA". - /// - [JsonProperty("scope", NullValueHandling = NullValueHandling.Ignore)] - public string Scope { get; set; } - - /// - /// The message format of the 2fa code. There are three values that the system will replace "{CODE}", "{NAME}", "{SCOPE}". The "{SCOPE}" and "{NAME} value template are optional, while "{CODE}" must be supplied. As the name would suggest, code will be replace with the actual 2fa code. Name is replaced with the application name, configured during provisioning of 2fa. The scope value is the same value sent during the call and partitioned by the server. - /// - [JsonProperty("message")] - public string Message { get; set; } - - /// - /// The number of digits for your 2fa code. The valid number ranges from 2 to 8, inclusively. - /// - [JsonProperty("digits")] - public double Digits { get; set; } - - } -} \ No newline at end of file diff --git a/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorMessagingResponse.cs b/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorMessagingResponse.cs deleted file mode 100644 index 8de4f102..00000000 --- a/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorMessagingResponse.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.TwoFactorAuth.Models -{ - public class TwoFactorMessagingResponse - { - public TwoFactorMessagingResponse() { } - - public TwoFactorMessagingResponse(string messageId = null) - { - MessageId = messageId; - } - - /// - /// Getter for messageId - /// - [JsonProperty("messageId", NullValueHandling = NullValueHandling.Ignore)] - public string MessageId { get; set; } - - } -} \ No newline at end of file diff --git a/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVerifyCodeResponse.cs b/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVerifyCodeResponse.cs deleted file mode 100644 index d06ddb2b..00000000 --- a/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVerifyCodeResponse.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.TwoFactorAuth.Models -{ - public class TwoFactorVerifyCodeResponse - { - public TwoFactorVerifyCodeResponse() { } - - public TwoFactorVerifyCodeResponse(bool? valid = null) - { - Valid = valid; - } - - /// - /// Getter for valid - /// - [JsonProperty("valid", NullValueHandling = NullValueHandling.Ignore)] - public bool? Valid { get; set; } - - } -} \ No newline at end of file diff --git a/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVerifyRequestSchema.cs b/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVerifyRequestSchema.cs deleted file mode 100644 index 56beddaf..00000000 --- a/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVerifyRequestSchema.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.TwoFactorAuth.Models -{ - public class TwoFactorVerifyRequestSchema - { - public TwoFactorVerifyRequestSchema() { } - - public TwoFactorVerifyRequestSchema(string to, - string applicationId, - double expirationTimeInMinutes, - string code, - string scope = null) - { - To = to; - ApplicationId = applicationId; - Scope = scope; - ExpirationTimeInMinutes = expirationTimeInMinutes; - Code = code; - } - - /// - /// The phone number to send the 2fa code to. - /// - [JsonProperty("to")] - public string To { get; set; } - - /// - /// The application unique ID, obtained from Bandwidth. - /// - [JsonProperty("applicationId")] - public string ApplicationId { get; set; } - - /// - /// An optional field to denote what scope or action the 2fa code is addressing. If not supplied, defaults to "2FA". - /// - [JsonProperty("scope", NullValueHandling = NullValueHandling.Ignore)] - public string Scope { get; set; } - - /// - /// The time period, in minutes, to validate the 2fa code. By setting this to 3 minutes, it will mean any code generated within the last 3 minutes are still valid. The valid range for expiration time is between 0 and 15 minutes, exclusively and inclusively, respectively. - /// - [JsonProperty("expirationTimeInMinutes")] - public double ExpirationTimeInMinutes { get; set; } - - /// - /// The generated 2fa code to check if valid - /// - [JsonProperty("code")] - public string Code { get; set; } - - } -} \ No newline at end of file diff --git a/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVoiceResponse.cs b/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVoiceResponse.cs deleted file mode 100644 index a6feccf7..00000000 --- a/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVoiceResponse.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.TwoFactorAuth.Models -{ - public class TwoFactorVoiceResponse - { - public TwoFactorVoiceResponse() { } - - public TwoFactorVoiceResponse(string callId = null) - { - CallId = callId; - } - - /// - /// Getter for callId - /// - [JsonProperty("callId", NullValueHandling = NullValueHandling.Ignore)] - public string CallId { get; set; } - - } -} \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Controllers/APIController.cs b/Bandwidth.Standard/Voice/Controllers/APIController.cs index 5e0c5e19..10e241a7 100644 --- a/Bandwidth.Standard/Voice/Controllers/APIController.cs +++ b/Bandwidth.Standard/Voice/Controllers/APIController.cs @@ -96,7 +96,7 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -106,27 +106,27 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -200,7 +200,7 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -210,27 +210,27 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -308,7 +308,7 @@ public async Task ModifyCallAsync(string accountId, string callId, Models.ApiMod //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -318,27 +318,27 @@ public async Task ModifyCallAsync(string accountId, string callId, Models.ApiMod if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -413,7 +413,7 @@ public async Task ModifyCallRecordingStateAsync(string accountId, string callId, //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -423,27 +423,27 @@ public async Task ModifyCallRecordingStateAsync(string accountId, string callId, if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -514,7 +514,7 @@ public async Task ModifyCallRecordingStateAsync(string accountId, string callId, //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -524,27 +524,27 @@ public async Task ModifyCallRecordingStateAsync(string accountId, string callId, if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -621,7 +621,7 @@ public async Task ModifyCallRecordingStateAsync(string accountId, string callId, //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -631,27 +631,27 @@ public async Task ModifyCallRecordingStateAsync(string accountId, string callId, if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -726,7 +726,7 @@ public async Task DeleteRecordingAsync(string accountId, string callId, string r //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -736,27 +736,27 @@ public async Task DeleteRecordingAsync(string accountId, string callId, string r if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -829,7 +829,7 @@ public async Task> GetStreamRecordingMediaAsync(string accou //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -839,27 +839,27 @@ public async Task> GetStreamRecordingMediaAsync(string accou if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -934,7 +934,7 @@ public async Task DeleteRecordingMediaAsync(string accountId, string callId, str //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -944,27 +944,27 @@ public async Task DeleteRecordingMediaAsync(string accountId, string callId, str if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1038,7 +1038,7 @@ public async Task DeleteRecordingMediaAsync(string accountId, string callId, str //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1048,27 +1048,27 @@ public async Task DeleteRecordingMediaAsync(string accountId, string callId, str if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1157,7 +1157,7 @@ public async Task CreateTranscribeRecordingAsync( //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1167,32 +1167,32 @@ public async Task CreateTranscribeRecordingAsync( if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 410) { - throw new ApiErrorResponseException("The media for this recording has been deleted, so we can't transcribe it", _context); + throw new ApiErrorResponseErrorException("The media for this recording has been deleted, so we can't transcribe it", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1264,7 +1264,7 @@ public async Task DeleteRecordingTranscriptionAsync(string accountId, string cal //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1274,27 +1274,27 @@ public async Task DeleteRecordingTranscriptionAsync(string accountId, string cal if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1394,7 +1394,7 @@ public async Task DeleteRecordingTranscriptionAsync(string accountId, string cal //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1404,27 +1404,27 @@ public async Task DeleteRecordingTranscriptionAsync(string accountId, string cal if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1498,7 +1498,7 @@ public async Task DeleteRecordingTranscriptionAsync(string accountId, string cal //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1508,27 +1508,27 @@ public async Task DeleteRecordingTranscriptionAsync(string accountId, string cal if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1606,7 +1606,7 @@ public async Task ModifyConferenceAsync(string accountId, string conferenceId, M //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1616,27 +1616,27 @@ public async Task ModifyConferenceAsync(string accountId, string conferenceId, M if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1722,7 +1722,7 @@ public async Task ModifyConferenceMemberAsync( //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1732,27 +1732,27 @@ public async Task ModifyConferenceMemberAsync( if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1826,7 +1826,7 @@ public async Task ModifyConferenceMemberAsync( //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1836,27 +1836,27 @@ public async Task ModifyConferenceMemberAsync( if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1930,7 +1930,7 @@ public async Task ModifyConferenceMemberAsync( //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1940,27 +1940,27 @@ public async Task ModifyConferenceMemberAsync( if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -2037,7 +2037,7 @@ public async Task ModifyConferenceMemberAsync( //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -2047,27 +2047,27 @@ public async Task ModifyConferenceMemberAsync( if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -2143,7 +2143,7 @@ public async Task> GetStreamConferenceRecordingMediaAsync(st //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -2153,27 +2153,27 @@ public async Task> GetStreamConferenceRecordingMediaAsync(st if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -2271,7 +2271,7 @@ public async Task> GetStreamConferenceRecordingMediaAsync(st //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -2281,27 +2281,27 @@ public async Task> GetStreamConferenceRecordingMediaAsync(st if (_response.StatusCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level diff --git a/Bandwidth.Standard/Voice/Exceptions/ApiErrorResponseException.cs b/Bandwidth.Standard/Voice/Exceptions/ApiErrorResponseErrorException.cs similarity index 88% rename from Bandwidth.Standard/Voice/Exceptions/ApiErrorResponseException.cs rename to Bandwidth.Standard/Voice/Exceptions/ApiErrorResponseErrorException.cs index 954a0048..92d28ae2 100644 --- a/Bandwidth.Standard/Voice/Exceptions/ApiErrorResponseException.cs +++ b/Bandwidth.Standard/Voice/Exceptions/ApiErrorResponseErrorException.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -20,14 +21,14 @@ namespace Bandwidth.Standard.Voice.Exceptions { - public class ApiErrorResponseException : ApiException + public class ApiErrorResponseErrorException : ApiException { /// /// Initialization constructor /// /// The reason for throwing exception /// The HTTP context that encapsulates request and response objects - public ApiErrorResponseException(string reason, HttpContext context) + public ApiErrorResponseErrorException(string reason, HttpContext context) : base(reason, context) { } /// diff --git a/Bandwidth.Standard/Voice/Models/ApiCallResponse.cs b/Bandwidth.Standard/Voice/Models/ApiCallResponse.cs index c2b9a702..dd8a7a74 100644 --- a/Bandwidth.Standard/Voice/Models/ApiCallResponse.cs +++ b/Bandwidth.Standard/Voice/Models/ApiCallResponse.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -185,5 +186,172 @@ public ApiCallResponse(string accountId, [JsonProperty("tag", NullValueHandling = NullValueHandling.Ignore)] public string Tag { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"ApiCallResponse : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"AccountId = {(AccountId == null ? "null" : AccountId == string.Empty ? "" : AccountId)}"); + toStringOutput.Add($"CallId = {(CallId == null ? "null" : CallId == string.Empty ? "" : CallId)}"); + toStringOutput.Add($"ApplicationId = {(ApplicationId == null ? "null" : ApplicationId == string.Empty ? "" : ApplicationId)}"); + toStringOutput.Add($"To = {(To == null ? "null" : To == string.Empty ? "" : To)}"); + toStringOutput.Add($"From = {(From == null ? "null" : From == string.Empty ? "" : From)}"); + toStringOutput.Add($"StartTime = {(StartTime == null ? "null" : StartTime.ToString())}"); + toStringOutput.Add($"CallUrl = {(CallUrl == null ? "null" : CallUrl == string.Empty ? "" : CallUrl)}"); + toStringOutput.Add($"CallTimeout = {(CallTimeout == null ? "null" : CallTimeout.ToString())}"); + toStringOutput.Add($"CallbackTimeout = {(CallbackTimeout == null ? "null" : CallbackTimeout.ToString())}"); + toStringOutput.Add($"AnswerUrl = {(AnswerUrl == null ? "null" : AnswerUrl == string.Empty ? "" : AnswerUrl)}"); + toStringOutput.Add($"AnswerMethod = {AnswerMethod}"); + toStringOutput.Add($"AnswerFallbackUrl = {(AnswerFallbackUrl == null ? "null" : AnswerFallbackUrl == string.Empty ? "" : AnswerFallbackUrl)}"); + toStringOutput.Add($"AnswerFallbackMethod = {(AnswerFallbackMethod == null ? "null" : AnswerFallbackMethod.ToString())}"); + toStringOutput.Add($"DisconnectUrl = {(DisconnectUrl == null ? "null" : DisconnectUrl == string.Empty ? "" : DisconnectUrl)}"); + toStringOutput.Add($"DisconnectMethod = {DisconnectMethod}"); + toStringOutput.Add($"Username = {(Username == null ? "null" : Username == string.Empty ? "" : Username)}"); + toStringOutput.Add($"Password = {(Password == null ? "null" : Password == string.Empty ? "" : Password)}"); + toStringOutput.Add($"FallbackUsername = {(FallbackUsername == null ? "null" : FallbackUsername == string.Empty ? "" : FallbackUsername)}"); + toStringOutput.Add($"FallbackPassword = {(FallbackPassword == null ? "null" : FallbackPassword == string.Empty ? "" : FallbackPassword)}"); + toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is ApiCallResponse other && + ((AccountId == null && other.AccountId == null) || (AccountId?.Equals(other.AccountId) == true)) && + ((CallId == null && other.CallId == null) || (CallId?.Equals(other.CallId) == true)) && + ((ApplicationId == null && other.ApplicationId == null) || (ApplicationId?.Equals(other.ApplicationId) == true)) && + ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && + ((From == null && other.From == null) || (From?.Equals(other.From) == true)) && + ((StartTime == null && other.StartTime == null) || (StartTime?.Equals(other.StartTime) == true)) && + ((CallUrl == null && other.CallUrl == null) || (CallUrl?.Equals(other.CallUrl) == true)) && + ((CallTimeout == null && other.CallTimeout == null) || (CallTimeout?.Equals(other.CallTimeout) == true)) && + ((CallbackTimeout == null && other.CallbackTimeout == null) || (CallbackTimeout?.Equals(other.CallbackTimeout) == true)) && + ((AnswerUrl == null && other.AnswerUrl == null) || (AnswerUrl?.Equals(other.AnswerUrl) == true)) && + AnswerMethod.Equals(other.AnswerMethod) && + ((AnswerFallbackUrl == null && other.AnswerFallbackUrl == null) || (AnswerFallbackUrl?.Equals(other.AnswerFallbackUrl) == true)) && + ((AnswerFallbackMethod == null && other.AnswerFallbackMethod == null) || (AnswerFallbackMethod?.Equals(other.AnswerFallbackMethod) == true)) && + ((DisconnectUrl == null && other.DisconnectUrl == null) || (DisconnectUrl?.Equals(other.DisconnectUrl) == true)) && + DisconnectMethod.Equals(other.DisconnectMethod) && + ((Username == null && other.Username == null) || (Username?.Equals(other.Username) == true)) && + ((Password == null && other.Password == null) || (Password?.Equals(other.Password) == true)) && + ((FallbackUsername == null && other.FallbackUsername == null) || (FallbackUsername?.Equals(other.FallbackUsername) == true)) && + ((FallbackPassword == null && other.FallbackPassword == null) || (FallbackPassword?.Equals(other.FallbackPassword) == true)) && + ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)); + } + + public override int GetHashCode() + { + int hashCode = 1215759600; + + if (AccountId != null) + { + hashCode += AccountId.GetHashCode(); + } + + if (CallId != null) + { + hashCode += CallId.GetHashCode(); + } + + if (ApplicationId != null) + { + hashCode += ApplicationId.GetHashCode(); + } + + if (To != null) + { + hashCode += To.GetHashCode(); + } + + if (From != null) + { + hashCode += From.GetHashCode(); + } + + if (StartTime != null) + { + hashCode += StartTime.GetHashCode(); + } + + if (CallUrl != null) + { + hashCode += CallUrl.GetHashCode(); + } + + if (CallTimeout != null) + { + hashCode += CallTimeout.GetHashCode(); + } + + if (CallbackTimeout != null) + { + hashCode += CallbackTimeout.GetHashCode(); + } + + if (AnswerUrl != null) + { + hashCode += AnswerUrl.GetHashCode(); + } + hashCode += AnswerMethod.GetHashCode(); + + if (AnswerFallbackUrl != null) + { + hashCode += AnswerFallbackUrl.GetHashCode(); + } + + if (AnswerFallbackMethod != null) + { + hashCode += AnswerFallbackMethod.GetHashCode(); + } + + if (DisconnectUrl != null) + { + hashCode += DisconnectUrl.GetHashCode(); + } + hashCode += DisconnectMethod.GetHashCode(); + + if (Username != null) + { + hashCode += Username.GetHashCode(); + } + + if (Password != null) + { + hashCode += Password.GetHashCode(); + } + + if (FallbackUsername != null) + { + hashCode += FallbackUsername.GetHashCode(); + } + + if (FallbackPassword != null) + { + hashCode += FallbackPassword.GetHashCode(); + } + + if (Tag != null) + { + hashCode += Tag.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ApiCallStateResponse.cs b/Bandwidth.Standard/Voice/Models/ApiCallStateResponse.cs index 7503af3f..14d6be47 100644 --- a/Bandwidth.Standard/Voice/Models/ApiCallStateResponse.cs +++ b/Bandwidth.Standard/Voice/Models/ApiCallStateResponse.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -29,6 +30,8 @@ public ApiCallStateResponse(string callId = null, string from = null, string direction = null, Models.StateEnum? state = null, + string identity = null, + Dictionary pai = null, DateTime? startTime = null, DateTime? answerTime = null, DateTime? endTime = null, @@ -45,6 +48,8 @@ public ApiCallStateResponse(string callId = null, From = from; Direction = direction; State = state; + Identity = identity; + Pai = pai; StartTime = startTime; AnswerTime = answerTime; EndTime = endTime; @@ -102,6 +107,18 @@ public ApiCallStateResponse(string callId = null, [JsonProperty("state", ItemConverterType = typeof(StringValuedEnumConverter), NullValueHandling = NullValueHandling.Ignore)] public Models.StateEnum? State { get; set; } + /// + /// Getter for identity + /// + [JsonProperty("identity", NullValueHandling = NullValueHandling.Ignore)] + public string Identity { get; set; } + + /// + /// Getter for pai + /// + [JsonProperty("pai", NullValueHandling = NullValueHandling.Ignore)] + public Dictionary Pai { get; set; } + /// /// Getter for startTime /// @@ -148,5 +165,159 @@ public ApiCallStateResponse(string callId = null, [JsonProperty("lastUpdate", NullValueHandling = NullValueHandling.Ignore)] public DateTime? LastUpdate { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"ApiCallStateResponse : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"CallId = {(CallId == null ? "null" : CallId == string.Empty ? "" : CallId)}"); + toStringOutput.Add($"ParentCallId = {(ParentCallId == null ? "null" : ParentCallId == string.Empty ? "" : ParentCallId)}"); + toStringOutput.Add($"ApplicationId = {(ApplicationId == null ? "null" : ApplicationId == string.Empty ? "" : ApplicationId)}"); + toStringOutput.Add($"AccountId = {(AccountId == null ? "null" : AccountId == string.Empty ? "" : AccountId)}"); + toStringOutput.Add($"To = {(To == null ? "null" : To == string.Empty ? "" : To)}"); + toStringOutput.Add($"From = {(From == null ? "null" : From == string.Empty ? "" : From)}"); + toStringOutput.Add($"Direction = {(Direction == null ? "null" : Direction == string.Empty ? "" : Direction)}"); + toStringOutput.Add($"State = {(State == null ? "null" : State.ToString())}"); + toStringOutput.Add($"Identity = {(Identity == null ? "null" : Identity == string.Empty ? "" : Identity)}"); + toStringOutput.Add($"Pai = {(Pai == null ? "null" : Pai.ToString())}"); + toStringOutput.Add($"StartTime = {(StartTime == null ? "null" : StartTime.ToString())}"); + toStringOutput.Add($"AnswerTime = {(AnswerTime == null ? "null" : AnswerTime.ToString())}"); + toStringOutput.Add($"EndTime = {(EndTime == null ? "null" : EndTime.ToString())}"); + toStringOutput.Add($"DisconnectCause = {(DisconnectCause == null ? "null" : DisconnectCause.ToString())}"); + toStringOutput.Add($"ErrorMessage = {(ErrorMessage == null ? "null" : ErrorMessage == string.Empty ? "" : ErrorMessage)}"); + toStringOutput.Add($"ErrorId = {(ErrorId == null ? "null" : ErrorId == string.Empty ? "" : ErrorId)}"); + toStringOutput.Add($"LastUpdate = {(LastUpdate == null ? "null" : LastUpdate.ToString())}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is ApiCallStateResponse other && + ((CallId == null && other.CallId == null) || (CallId?.Equals(other.CallId) == true)) && + ((ParentCallId == null && other.ParentCallId == null) || (ParentCallId?.Equals(other.ParentCallId) == true)) && + ((ApplicationId == null && other.ApplicationId == null) || (ApplicationId?.Equals(other.ApplicationId) == true)) && + ((AccountId == null && other.AccountId == null) || (AccountId?.Equals(other.AccountId) == true)) && + ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && + ((From == null && other.From == null) || (From?.Equals(other.From) == true)) && + ((Direction == null && other.Direction == null) || (Direction?.Equals(other.Direction) == true)) && + ((State == null && other.State == null) || (State?.Equals(other.State) == true)) && + ((Identity == null && other.Identity == null) || (Identity?.Equals(other.Identity) == true)) && + ((Pai == null && other.Pai == null) || (Pai?.Equals(other.Pai) == true)) && + ((StartTime == null && other.StartTime == null) || (StartTime?.Equals(other.StartTime) == true)) && + ((AnswerTime == null && other.AnswerTime == null) || (AnswerTime?.Equals(other.AnswerTime) == true)) && + ((EndTime == null && other.EndTime == null) || (EndTime?.Equals(other.EndTime) == true)) && + ((DisconnectCause == null && other.DisconnectCause == null) || (DisconnectCause?.Equals(other.DisconnectCause) == true)) && + ((ErrorMessage == null && other.ErrorMessage == null) || (ErrorMessage?.Equals(other.ErrorMessage) == true)) && + ((ErrorId == null && other.ErrorId == null) || (ErrorId?.Equals(other.ErrorId) == true)) && + ((LastUpdate == null && other.LastUpdate == null) || (LastUpdate?.Equals(other.LastUpdate) == true)); + } + + public override int GetHashCode() + { + int hashCode = -1002659328; + + if (CallId != null) + { + hashCode += CallId.GetHashCode(); + } + + if (ParentCallId != null) + { + hashCode += ParentCallId.GetHashCode(); + } + + if (ApplicationId != null) + { + hashCode += ApplicationId.GetHashCode(); + } + + if (AccountId != null) + { + hashCode += AccountId.GetHashCode(); + } + + if (To != null) + { + hashCode += To.GetHashCode(); + } + + if (From != null) + { + hashCode += From.GetHashCode(); + } + + if (Direction != null) + { + hashCode += Direction.GetHashCode(); + } + + if (State != null) + { + hashCode += State.GetHashCode(); + } + + if (Identity != null) + { + hashCode += Identity.GetHashCode(); + } + + if (Pai != null) + { + hashCode += Pai.GetHashCode(); + } + + if (StartTime != null) + { + hashCode += StartTime.GetHashCode(); + } + + if (AnswerTime != null) + { + hashCode += AnswerTime.GetHashCode(); + } + + if (EndTime != null) + { + hashCode += EndTime.GetHashCode(); + } + + if (DisconnectCause != null) + { + hashCode += DisconnectCause.GetHashCode(); + } + + if (ErrorMessage != null) + { + hashCode += ErrorMessage.GetHashCode(); + } + + if (ErrorId != null) + { + hashCode += ErrorId.GetHashCode(); + } + + if (LastUpdate != null) + { + hashCode += LastUpdate.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ApiCreateCallRequest.cs b/Bandwidth.Standard/Voice/Models/ApiCreateCallRequest.cs index a0fcaa7c..0a84acd6 100644 --- a/Bandwidth.Standard/Voice/Models/ApiCreateCallRequest.cs +++ b/Bandwidth.Standard/Voice/Models/ApiCreateCallRequest.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -176,5 +177,173 @@ public ApiCreateCallRequest(string from, [JsonProperty("obfuscatedFrom", NullValueHandling = NullValueHandling.Ignore)] public string ObfuscatedFrom { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"ApiCreateCallRequest : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"From = {(From == null ? "null" : From == string.Empty ? "" : From)}"); + toStringOutput.Add($"To = {(To == null ? "null" : To == string.Empty ? "" : To)}"); + toStringOutput.Add($"Uui = {(Uui == null ? "null" : Uui == string.Empty ? "" : Uui)}"); + toStringOutput.Add($"CallTimeout = {(CallTimeout == null ? "null" : CallTimeout.ToString())}"); + toStringOutput.Add($"CallbackTimeout = {(CallbackTimeout == null ? "null" : CallbackTimeout.ToString())}"); + toStringOutput.Add($"AnswerUrl = {(AnswerUrl == null ? "null" : AnswerUrl == string.Empty ? "" : AnswerUrl)}"); + toStringOutput.Add($"AnswerFallbackUrl = {(AnswerFallbackUrl == null ? "null" : AnswerFallbackUrl == string.Empty ? "" : AnswerFallbackUrl)}"); + toStringOutput.Add($"Username = {(Username == null ? "null" : Username == string.Empty ? "" : Username)}"); + toStringOutput.Add($"Password = {(Password == null ? "null" : Password == string.Empty ? "" : Password)}"); + toStringOutput.Add($"FallbackUsername = {(FallbackUsername == null ? "null" : FallbackUsername == string.Empty ? "" : FallbackUsername)}"); + toStringOutput.Add($"FallbackPassword = {(FallbackPassword == null ? "null" : FallbackPassword == string.Empty ? "" : FallbackPassword)}"); + toStringOutput.Add($"AnswerMethod = {(AnswerMethod == null ? "null" : AnswerMethod.ToString())}"); + toStringOutput.Add($"AnswerFallbackMethod = {(AnswerFallbackMethod == null ? "null" : AnswerFallbackMethod.ToString())}"); + toStringOutput.Add($"DisconnectUrl = {(DisconnectUrl == null ? "null" : DisconnectUrl == string.Empty ? "" : DisconnectUrl)}"); + toStringOutput.Add($"DisconnectMethod = {(DisconnectMethod == null ? "null" : DisconnectMethod.ToString())}"); + toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); + toStringOutput.Add($"ApplicationId = {(ApplicationId == null ? "null" : ApplicationId == string.Empty ? "" : ApplicationId)}"); + toStringOutput.Add($"ObfuscatedTo = {(ObfuscatedTo == null ? "null" : ObfuscatedTo == string.Empty ? "" : ObfuscatedTo)}"); + toStringOutput.Add($"ObfuscatedFrom = {(ObfuscatedFrom == null ? "null" : ObfuscatedFrom == string.Empty ? "" : ObfuscatedFrom)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is ApiCreateCallRequest other && + ((From == null && other.From == null) || (From?.Equals(other.From) == true)) && + ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && + ((Uui == null && other.Uui == null) || (Uui?.Equals(other.Uui) == true)) && + ((CallTimeout == null && other.CallTimeout == null) || (CallTimeout?.Equals(other.CallTimeout) == true)) && + ((CallbackTimeout == null && other.CallbackTimeout == null) || (CallbackTimeout?.Equals(other.CallbackTimeout) == true)) && + ((AnswerUrl == null && other.AnswerUrl == null) || (AnswerUrl?.Equals(other.AnswerUrl) == true)) && + ((AnswerFallbackUrl == null && other.AnswerFallbackUrl == null) || (AnswerFallbackUrl?.Equals(other.AnswerFallbackUrl) == true)) && + ((Username == null && other.Username == null) || (Username?.Equals(other.Username) == true)) && + ((Password == null && other.Password == null) || (Password?.Equals(other.Password) == true)) && + ((FallbackUsername == null && other.FallbackUsername == null) || (FallbackUsername?.Equals(other.FallbackUsername) == true)) && + ((FallbackPassword == null && other.FallbackPassword == null) || (FallbackPassword?.Equals(other.FallbackPassword) == true)) && + ((AnswerMethod == null && other.AnswerMethod == null) || (AnswerMethod?.Equals(other.AnswerMethod) == true)) && + ((AnswerFallbackMethod == null && other.AnswerFallbackMethod == null) || (AnswerFallbackMethod?.Equals(other.AnswerFallbackMethod) == true)) && + ((DisconnectUrl == null && other.DisconnectUrl == null) || (DisconnectUrl?.Equals(other.DisconnectUrl) == true)) && + ((DisconnectMethod == null && other.DisconnectMethod == null) || (DisconnectMethod?.Equals(other.DisconnectMethod) == true)) && + ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)) && + ((ApplicationId == null && other.ApplicationId == null) || (ApplicationId?.Equals(other.ApplicationId) == true)) && + ((ObfuscatedTo == null && other.ObfuscatedTo == null) || (ObfuscatedTo?.Equals(other.ObfuscatedTo) == true)) && + ((ObfuscatedFrom == null && other.ObfuscatedFrom == null) || (ObfuscatedFrom?.Equals(other.ObfuscatedFrom) == true)); + } + + public override int GetHashCode() + { + int hashCode = 1731410917; + + if (From != null) + { + hashCode += From.GetHashCode(); + } + + if (To != null) + { + hashCode += To.GetHashCode(); + } + + if (Uui != null) + { + hashCode += Uui.GetHashCode(); + } + + if (CallTimeout != null) + { + hashCode += CallTimeout.GetHashCode(); + } + + if (CallbackTimeout != null) + { + hashCode += CallbackTimeout.GetHashCode(); + } + + if (AnswerUrl != null) + { + hashCode += AnswerUrl.GetHashCode(); + } + + if (AnswerFallbackUrl != null) + { + hashCode += AnswerFallbackUrl.GetHashCode(); + } + + if (Username != null) + { + hashCode += Username.GetHashCode(); + } + + if (Password != null) + { + hashCode += Password.GetHashCode(); + } + + if (FallbackUsername != null) + { + hashCode += FallbackUsername.GetHashCode(); + } + + if (FallbackPassword != null) + { + hashCode += FallbackPassword.GetHashCode(); + } + + if (AnswerMethod != null) + { + hashCode += AnswerMethod.GetHashCode(); + } + + if (AnswerFallbackMethod != null) + { + hashCode += AnswerFallbackMethod.GetHashCode(); + } + + if (DisconnectUrl != null) + { + hashCode += DisconnectUrl.GetHashCode(); + } + + if (DisconnectMethod != null) + { + hashCode += DisconnectMethod.GetHashCode(); + } + + if (Tag != null) + { + hashCode += Tag.GetHashCode(); + } + + if (ApplicationId != null) + { + hashCode += ApplicationId.GetHashCode(); + } + + if (ObfuscatedTo != null) + { + hashCode += ObfuscatedTo.GetHashCode(); + } + + if (ObfuscatedFrom != null) + { + hashCode += ObfuscatedFrom.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ApiErrorResponse.cs b/Bandwidth.Standard/Voice/Models/ApiErrorResponse.cs new file mode 100644 index 00000000..260afad5 --- /dev/null +++ b/Bandwidth.Standard/Voice/Models/ApiErrorResponse.cs @@ -0,0 +1,109 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.Voice.Models +{ + public class ApiErrorResponse + { + public ApiErrorResponse() { } + + public ApiErrorResponse(string type = null, + string description = null, + string id = null) + { + Type = type; + Description = description; + Id = id; + } + + /// + /// Getter for type + /// + [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)] + public string Type { get; set; } + + /// + /// Getter for description + /// + [JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)] + public string Description { get; set; } + + /// + /// Getter for id + /// + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"ApiErrorResponse : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Type = {(Type == null ? "null" : Type == string.Empty ? "" : Type)}"); + toStringOutput.Add($"Description = {(Description == null ? "null" : Description == string.Empty ? "" : Description)}"); + toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is ApiErrorResponse other && + ((Type == null && other.Type == null) || (Type?.Equals(other.Type) == true)) && + ((Description == null && other.Description == null) || (Description?.Equals(other.Description) == true)) && + ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)); + } + + public override int GetHashCode() + { + int hashCode = -1389149027; + + if (Type != null) + { + hashCode += Type.GetHashCode(); + } + + if (Description != null) + { + hashCode += Description.GetHashCode(); + } + + if (Id != null) + { + hashCode += Id.GetHashCode(); + } + + return hashCode; + } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ApiModifyCallRequest.cs b/Bandwidth.Standard/Voice/Models/ApiModifyCallRequest.cs index 22df79f9..73e30a56 100644 --- a/Bandwidth.Standard/Voice/Models/ApiModifyCallRequest.cs +++ b/Bandwidth.Standard/Voice/Models/ApiModifyCallRequest.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -104,5 +105,110 @@ public ApiModifyCallRequest(string redirectUrl, [JsonProperty("tag", NullValueHandling = NullValueHandling.Ignore)] public string Tag { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"ApiModifyCallRequest : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"State = {(State == null ? "null" : State.ToString())}"); + toStringOutput.Add($"RedirectUrl = {(RedirectUrl == null ? "null" : RedirectUrl == string.Empty ? "" : RedirectUrl)}"); + toStringOutput.Add($"RedirectFallbackUrl = {(RedirectFallbackUrl == null ? "null" : RedirectFallbackUrl == string.Empty ? "" : RedirectFallbackUrl)}"); + toStringOutput.Add($"RedirectMethod = {(RedirectMethod == null ? "null" : RedirectMethod.ToString())}"); + toStringOutput.Add($"RedirectFallbackMethod = {(RedirectFallbackMethod == null ? "null" : RedirectFallbackMethod.ToString())}"); + toStringOutput.Add($"Username = {(Username == null ? "null" : Username == string.Empty ? "" : Username)}"); + toStringOutput.Add($"Password = {(Password == null ? "null" : Password == string.Empty ? "" : Password)}"); + toStringOutput.Add($"FallbackUsername = {(FallbackUsername == null ? "null" : FallbackUsername == string.Empty ? "" : FallbackUsername)}"); + toStringOutput.Add($"FallbackPassword = {(FallbackPassword == null ? "null" : FallbackPassword == string.Empty ? "" : FallbackPassword)}"); + toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is ApiModifyCallRequest other && + ((State == null && other.State == null) || (State?.Equals(other.State) == true)) && + ((RedirectUrl == null && other.RedirectUrl == null) || (RedirectUrl?.Equals(other.RedirectUrl) == true)) && + ((RedirectFallbackUrl == null && other.RedirectFallbackUrl == null) || (RedirectFallbackUrl?.Equals(other.RedirectFallbackUrl) == true)) && + ((RedirectMethod == null && other.RedirectMethod == null) || (RedirectMethod?.Equals(other.RedirectMethod) == true)) && + ((RedirectFallbackMethod == null && other.RedirectFallbackMethod == null) || (RedirectFallbackMethod?.Equals(other.RedirectFallbackMethod) == true)) && + ((Username == null && other.Username == null) || (Username?.Equals(other.Username) == true)) && + ((Password == null && other.Password == null) || (Password?.Equals(other.Password) == true)) && + ((FallbackUsername == null && other.FallbackUsername == null) || (FallbackUsername?.Equals(other.FallbackUsername) == true)) && + ((FallbackPassword == null && other.FallbackPassword == null) || (FallbackPassword?.Equals(other.FallbackPassword) == true)) && + ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)); + } + + public override int GetHashCode() + { + int hashCode = 2064765237; + + if (State != null) + { + hashCode += State.GetHashCode(); + } + + if (RedirectUrl != null) + { + hashCode += RedirectUrl.GetHashCode(); + } + + if (RedirectFallbackUrl != null) + { + hashCode += RedirectFallbackUrl.GetHashCode(); + } + + if (RedirectMethod != null) + { + hashCode += RedirectMethod.GetHashCode(); + } + + if (RedirectFallbackMethod != null) + { + hashCode += RedirectFallbackMethod.GetHashCode(); + } + + if (Username != null) + { + hashCode += Username.GetHashCode(); + } + + if (Password != null) + { + hashCode += Password.GetHashCode(); + } + + if (FallbackUsername != null) + { + hashCode += FallbackUsername.GetHashCode(); + } + + if (FallbackPassword != null) + { + hashCode += FallbackPassword.GetHashCode(); + } + + if (Tag != null) + { + hashCode += Tag.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ApiModifyConferenceRequest.cs b/Bandwidth.Standard/Voice/Models/ApiModifyConferenceRequest.cs index 40ec3f85..e837992f 100644 --- a/Bandwidth.Standard/Voice/Models/ApiModifyConferenceRequest.cs +++ b/Bandwidth.Standard/Voice/Models/ApiModifyConferenceRequest.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -96,5 +97,103 @@ public ApiModifyConferenceRequest(Models.StatusEnum? status = null, [JsonProperty("fallbackPassword", NullValueHandling = NullValueHandling.Ignore)] public string FallbackPassword { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"ApiModifyConferenceRequest : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Status = {(Status == null ? "null" : Status.ToString())}"); + toStringOutput.Add($"RedirectUrl = {(RedirectUrl == null ? "null" : RedirectUrl == string.Empty ? "" : RedirectUrl)}"); + toStringOutput.Add($"RedirectFallbackUrl = {(RedirectFallbackUrl == null ? "null" : RedirectFallbackUrl == string.Empty ? "" : RedirectFallbackUrl)}"); + toStringOutput.Add($"RedirectMethod = {(RedirectMethod == null ? "null" : RedirectMethod.ToString())}"); + toStringOutput.Add($"RedirectFallbackMethod = {(RedirectFallbackMethod == null ? "null" : RedirectFallbackMethod.ToString())}"); + toStringOutput.Add($"Username = {(Username == null ? "null" : Username == string.Empty ? "" : Username)}"); + toStringOutput.Add($"Password = {(Password == null ? "null" : Password == string.Empty ? "" : Password)}"); + toStringOutput.Add($"FallbackUsername = {(FallbackUsername == null ? "null" : FallbackUsername == string.Empty ? "" : FallbackUsername)}"); + toStringOutput.Add($"FallbackPassword = {(FallbackPassword == null ? "null" : FallbackPassword == string.Empty ? "" : FallbackPassword)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is ApiModifyConferenceRequest other && + ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true)) && + ((RedirectUrl == null && other.RedirectUrl == null) || (RedirectUrl?.Equals(other.RedirectUrl) == true)) && + ((RedirectFallbackUrl == null && other.RedirectFallbackUrl == null) || (RedirectFallbackUrl?.Equals(other.RedirectFallbackUrl) == true)) && + ((RedirectMethod == null && other.RedirectMethod == null) || (RedirectMethod?.Equals(other.RedirectMethod) == true)) && + ((RedirectFallbackMethod == null && other.RedirectFallbackMethod == null) || (RedirectFallbackMethod?.Equals(other.RedirectFallbackMethod) == true)) && + ((Username == null && other.Username == null) || (Username?.Equals(other.Username) == true)) && + ((Password == null && other.Password == null) || (Password?.Equals(other.Password) == true)) && + ((FallbackUsername == null && other.FallbackUsername == null) || (FallbackUsername?.Equals(other.FallbackUsername) == true)) && + ((FallbackPassword == null && other.FallbackPassword == null) || (FallbackPassword?.Equals(other.FallbackPassword) == true)); + } + + public override int GetHashCode() + { + int hashCode = -276202593; + + if (Status != null) + { + hashCode += Status.GetHashCode(); + } + + if (RedirectUrl != null) + { + hashCode += RedirectUrl.GetHashCode(); + } + + if (RedirectFallbackUrl != null) + { + hashCode += RedirectFallbackUrl.GetHashCode(); + } + + if (RedirectMethod != null) + { + hashCode += RedirectMethod.GetHashCode(); + } + + if (RedirectFallbackMethod != null) + { + hashCode += RedirectFallbackMethod.GetHashCode(); + } + + if (Username != null) + { + hashCode += Username.GetHashCode(); + } + + if (Password != null) + { + hashCode += Password.GetHashCode(); + } + + if (FallbackUsername != null) + { + hashCode += FallbackUsername.GetHashCode(); + } + + if (FallbackPassword != null) + { + hashCode += FallbackPassword.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ApiTranscribeRecordingRequest.cs b/Bandwidth.Standard/Voice/Models/ApiTranscribeRecordingRequest.cs index 773ca5d7..256d80d0 100644 --- a/Bandwidth.Standard/Voice/Models/ApiTranscribeRecordingRequest.cs +++ b/Bandwidth.Standard/Voice/Models/ApiTranscribeRecordingRequest.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -72,5 +73,82 @@ public ApiTranscribeRecordingRequest(string callbackUrl = null, [JsonProperty("callbackTimeout", NullValueHandling = NullValueHandling.Ignore)] public double? CallbackTimeout { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"ApiTranscribeRecordingRequest : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"CallbackUrl = {(CallbackUrl == null ? "null" : CallbackUrl == string.Empty ? "" : CallbackUrl)}"); + toStringOutput.Add($"CallbackMethod = {(CallbackMethod == null ? "null" : CallbackMethod.ToString())}"); + toStringOutput.Add($"Username = {(Username == null ? "null" : Username == string.Empty ? "" : Username)}"); + toStringOutput.Add($"Password = {(Password == null ? "null" : Password == string.Empty ? "" : Password)}"); + toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); + toStringOutput.Add($"CallbackTimeout = {(CallbackTimeout == null ? "null" : CallbackTimeout.ToString())}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is ApiTranscribeRecordingRequest other && + ((CallbackUrl == null && other.CallbackUrl == null) || (CallbackUrl?.Equals(other.CallbackUrl) == true)) && + ((CallbackMethod == null && other.CallbackMethod == null) || (CallbackMethod?.Equals(other.CallbackMethod) == true)) && + ((Username == null && other.Username == null) || (Username?.Equals(other.Username) == true)) && + ((Password == null && other.Password == null) || (Password?.Equals(other.Password) == true)) && + ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)) && + ((CallbackTimeout == null && other.CallbackTimeout == null) || (CallbackTimeout?.Equals(other.CallbackTimeout) == true)); + } + + public override int GetHashCode() + { + int hashCode = 1283937202; + + if (CallbackUrl != null) + { + hashCode += CallbackUrl.GetHashCode(); + } + + if (CallbackMethod != null) + { + hashCode += CallbackMethod.GetHashCode(); + } + + if (Username != null) + { + hashCode += Username.GetHashCode(); + } + + if (Password != null) + { + hashCode += Password.GetHashCode(); + } + + if (Tag != null) + { + hashCode += Tag.GetHashCode(); + } + + if (CallbackTimeout != null) + { + hashCode += CallbackTimeout.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ConferenceDetail.cs b/Bandwidth.Standard/Voice/Models/ConferenceDetail.cs index 06e6f8ea..252b4083 100644 --- a/Bandwidth.Standard/Voice/Models/ConferenceDetail.cs +++ b/Bandwidth.Standard/Voice/Models/ConferenceDetail.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -90,5 +91,96 @@ public ConferenceDetail(string id = null, [JsonProperty("activeMembers", NullValueHandling = NullValueHandling.Ignore)] public List ActiveMembers { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"ConferenceDetail : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}"); + toStringOutput.Add($"Name = {(Name == null ? "null" : Name == string.Empty ? "" : Name)}"); + toStringOutput.Add($"CreatedTime = {(CreatedTime == null ? "null" : CreatedTime.ToString())}"); + toStringOutput.Add($"CompletedTime = {(CompletedTime == null ? "null" : CompletedTime.ToString())}"); + toStringOutput.Add($"ConferenceEventUrl = {(ConferenceEventUrl == null ? "null" : ConferenceEventUrl == string.Empty ? "" : ConferenceEventUrl)}"); + toStringOutput.Add($"ConferenceEventMethod = {(ConferenceEventMethod == null ? "null" : ConferenceEventMethod.ToString())}"); + toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); + toStringOutput.Add($"ActiveMembers = {(ActiveMembers == null ? "null" : $"[{ string.Join(", ", ActiveMembers)} ]")}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is ConferenceDetail other && + ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) && + ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) && + ((CreatedTime == null && other.CreatedTime == null) || (CreatedTime?.Equals(other.CreatedTime) == true)) && + ((CompletedTime == null && other.CompletedTime == null) || (CompletedTime?.Equals(other.CompletedTime) == true)) && + ((ConferenceEventUrl == null && other.ConferenceEventUrl == null) || (ConferenceEventUrl?.Equals(other.ConferenceEventUrl) == true)) && + ((ConferenceEventMethod == null && other.ConferenceEventMethod == null) || (ConferenceEventMethod?.Equals(other.ConferenceEventMethod) == true)) && + ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)) && + ((ActiveMembers == null && other.ActiveMembers == null) || (ActiveMembers?.Equals(other.ActiveMembers) == true)); + } + + public override int GetHashCode() + { + int hashCode = 957632881; + + if (Id != null) + { + hashCode += Id.GetHashCode(); + } + + if (Name != null) + { + hashCode += Name.GetHashCode(); + } + + if (CreatedTime != null) + { + hashCode += CreatedTime.GetHashCode(); + } + + if (CompletedTime != null) + { + hashCode += CompletedTime.GetHashCode(); + } + + if (ConferenceEventUrl != null) + { + hashCode += ConferenceEventUrl.GetHashCode(); + } + + if (ConferenceEventMethod != null) + { + hashCode += ConferenceEventMethod.GetHashCode(); + } + + if (Tag != null) + { + hashCode += Tag.GetHashCode(); + } + + if (ActiveMembers != null) + { + hashCode += ActiveMembers.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ConferenceMemberDetail.cs b/Bandwidth.Standard/Voice/Models/ConferenceMemberDetail.cs index 3c2ccf0c..4054b04f 100644 --- a/Bandwidth.Standard/Voice/Models/ConferenceMemberDetail.cs +++ b/Bandwidth.Standard/Voice/Models/ConferenceMemberDetail.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -72,5 +73,82 @@ public ConferenceMemberDetail(string callId = null, [JsonProperty("callIdsToCoach", NullValueHandling = NullValueHandling.Ignore)] public List CallIdsToCoach { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"ConferenceMemberDetail : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"CallId = {(CallId == null ? "null" : CallId == string.Empty ? "" : CallId)}"); + toStringOutput.Add($"ConferenceId = {(ConferenceId == null ? "null" : ConferenceId == string.Empty ? "" : ConferenceId)}"); + toStringOutput.Add($"MemberUrl = {(MemberUrl == null ? "null" : MemberUrl == string.Empty ? "" : MemberUrl)}"); + toStringOutput.Add($"Mute = {(Mute == null ? "null" : Mute.ToString())}"); + toStringOutput.Add($"Hold = {(Hold == null ? "null" : Hold.ToString())}"); + toStringOutput.Add($"CallIdsToCoach = {(CallIdsToCoach == null ? "null" : $"[{ string.Join(", ", CallIdsToCoach)} ]")}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is ConferenceMemberDetail other && + ((CallId == null && other.CallId == null) || (CallId?.Equals(other.CallId) == true)) && + ((ConferenceId == null && other.ConferenceId == null) || (ConferenceId?.Equals(other.ConferenceId) == true)) && + ((MemberUrl == null && other.MemberUrl == null) || (MemberUrl?.Equals(other.MemberUrl) == true)) && + ((Mute == null && other.Mute == null) || (Mute?.Equals(other.Mute) == true)) && + ((Hold == null && other.Hold == null) || (Hold?.Equals(other.Hold) == true)) && + ((CallIdsToCoach == null && other.CallIdsToCoach == null) || (CallIdsToCoach?.Equals(other.CallIdsToCoach) == true)); + } + + public override int GetHashCode() + { + int hashCode = -736159189; + + if (CallId != null) + { + hashCode += CallId.GetHashCode(); + } + + if (ConferenceId != null) + { + hashCode += ConferenceId.GetHashCode(); + } + + if (MemberUrl != null) + { + hashCode += MemberUrl.GetHashCode(); + } + + if (Mute != null) + { + hashCode += Mute.GetHashCode(); + } + + if (Hold != null) + { + hashCode += Hold.GetHashCode(); + } + + if (CallIdsToCoach != null) + { + hashCode += CallIdsToCoach.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ConferenceRecordingMetadataResponse.cs b/Bandwidth.Standard/Voice/Models/ConferenceRecordingMetadataResponse.cs index 72b83074..dface26f 100644 --- a/Bandwidth.Standard/Voice/Models/ConferenceRecordingMetadataResponse.cs +++ b/Bandwidth.Standard/Voice/Models/ConferenceRecordingMetadataResponse.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -114,5 +115,117 @@ public ConferenceRecordingMetadataResponse(string accountId = null, [JsonProperty("mediaUrl", NullValueHandling = NullValueHandling.Ignore)] public string MediaUrl { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"ConferenceRecordingMetadataResponse : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"AccountId = {(AccountId == null ? "null" : AccountId == string.Empty ? "" : AccountId)}"); + toStringOutput.Add($"ConferenceId = {(ConferenceId == null ? "null" : ConferenceId == string.Empty ? "" : ConferenceId)}"); + toStringOutput.Add($"Name = {(Name == null ? "null" : Name == string.Empty ? "" : Name)}"); + toStringOutput.Add($"RecordingId = {(RecordingId == null ? "null" : RecordingId == string.Empty ? "" : RecordingId)}"); + toStringOutput.Add($"Duration = {(Duration == null ? "null" : Duration == string.Empty ? "" : Duration)}"); + toStringOutput.Add($"Channels = {(Channels == null ? "null" : Channels.ToString())}"); + toStringOutput.Add($"StartTime = {(StartTime == null ? "null" : StartTime.ToString())}"); + toStringOutput.Add($"EndTime = {(EndTime == null ? "null" : EndTime.ToString())}"); + toStringOutput.Add($"FileFormat = {(FileFormat == null ? "null" : FileFormat.ToString())}"); + toStringOutput.Add($"Status = {(Status == null ? "null" : Status.ToString())}"); + toStringOutput.Add($"MediaUrl = {(MediaUrl == null ? "null" : MediaUrl == string.Empty ? "" : MediaUrl)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is ConferenceRecordingMetadataResponse other && + ((AccountId == null && other.AccountId == null) || (AccountId?.Equals(other.AccountId) == true)) && + ((ConferenceId == null && other.ConferenceId == null) || (ConferenceId?.Equals(other.ConferenceId) == true)) && + ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) && + ((RecordingId == null && other.RecordingId == null) || (RecordingId?.Equals(other.RecordingId) == true)) && + ((Duration == null && other.Duration == null) || (Duration?.Equals(other.Duration) == true)) && + ((Channels == null && other.Channels == null) || (Channels?.Equals(other.Channels) == true)) && + ((StartTime == null && other.StartTime == null) || (StartTime?.Equals(other.StartTime) == true)) && + ((EndTime == null && other.EndTime == null) || (EndTime?.Equals(other.EndTime) == true)) && + ((FileFormat == null && other.FileFormat == null) || (FileFormat?.Equals(other.FileFormat) == true)) && + ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true)) && + ((MediaUrl == null && other.MediaUrl == null) || (MediaUrl?.Equals(other.MediaUrl) == true)); + } + + public override int GetHashCode() + { + int hashCode = -898132204; + + if (AccountId != null) + { + hashCode += AccountId.GetHashCode(); + } + + if (ConferenceId != null) + { + hashCode += ConferenceId.GetHashCode(); + } + + if (Name != null) + { + hashCode += Name.GetHashCode(); + } + + if (RecordingId != null) + { + hashCode += RecordingId.GetHashCode(); + } + + if (Duration != null) + { + hashCode += Duration.GetHashCode(); + } + + if (Channels != null) + { + hashCode += Channels.GetHashCode(); + } + + if (StartTime != null) + { + hashCode += StartTime.GetHashCode(); + } + + if (EndTime != null) + { + hashCode += EndTime.GetHashCode(); + } + + if (FileFormat != null) + { + hashCode += FileFormat.GetHashCode(); + } + + if (Status != null) + { + hashCode += Status.GetHashCode(); + } + + if (MediaUrl != null) + { + hashCode += MediaUrl.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ModifyCallRecordingState.cs b/Bandwidth.Standard/Voice/Models/ModifyCallRecordingState.cs index 6746caee..1c3ca5c9 100644 --- a/Bandwidth.Standard/Voice/Models/ModifyCallRecordingState.cs +++ b/Bandwidth.Standard/Voice/Models/ModifyCallRecordingState.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -32,5 +33,43 @@ public ModifyCallRecordingState(Models.State2Enum state) [JsonProperty("state", ItemConverterType = typeof(StringValuedEnumConverter))] public Models.State2Enum State { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"ModifyCallRecordingState : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"State = {State}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is ModifyCallRecordingState other && + State.Equals(other.State); + } + + public override int GetHashCode() + { + int hashCode = -1521564479; + hashCode += State.GetHashCode(); + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/RecordingMetadataResponse.cs b/Bandwidth.Standard/Voice/Models/RecordingMetadataResponse.cs index 125bf296..579fb446 100644 --- a/Bandwidth.Standard/Voice/Models/RecordingMetadataResponse.cs +++ b/Bandwidth.Standard/Voice/Models/RecordingMetadataResponse.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -170,5 +171,166 @@ public RecordingMetadataResponse(string applicationId = null, [JsonProperty("transcription", NullValueHandling = NullValueHandling.Ignore)] public Models.Transcription Transcription { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"RecordingMetadataResponse : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"ApplicationId = {(ApplicationId == null ? "null" : ApplicationId == string.Empty ? "" : ApplicationId)}"); + toStringOutput.Add($"AccountId = {(AccountId == null ? "null" : AccountId == string.Empty ? "" : AccountId)}"); + toStringOutput.Add($"CallId = {(CallId == null ? "null" : CallId == string.Empty ? "" : CallId)}"); + toStringOutput.Add($"ParentCallId = {(ParentCallId == null ? "null" : ParentCallId == string.Empty ? "" : ParentCallId)}"); + toStringOutput.Add($"RecordingId = {(RecordingId == null ? "null" : RecordingId == string.Empty ? "" : RecordingId)}"); + toStringOutput.Add($"To = {(To == null ? "null" : To == string.Empty ? "" : To)}"); + toStringOutput.Add($"From = {(From == null ? "null" : From == string.Empty ? "" : From)}"); + toStringOutput.Add($"TransferCallerId = {(TransferCallerId == null ? "null" : TransferCallerId == string.Empty ? "" : TransferCallerId)}"); + toStringOutput.Add($"TransferTo = {(TransferTo == null ? "null" : TransferTo == string.Empty ? "" : TransferTo)}"); + toStringOutput.Add($"Duration = {(Duration == null ? "null" : Duration == string.Empty ? "" : Duration)}"); + toStringOutput.Add($"Direction = {(Direction == null ? "null" : Direction.ToString())}"); + toStringOutput.Add($"Channels = {(Channels == null ? "null" : Channels.ToString())}"); + toStringOutput.Add($"StartTime = {(StartTime == null ? "null" : StartTime.ToString())}"); + toStringOutput.Add($"EndTime = {(EndTime == null ? "null" : EndTime.ToString())}"); + toStringOutput.Add($"FileFormat = {(FileFormat == null ? "null" : FileFormat.ToString())}"); + toStringOutput.Add($"Status = {(Status == null ? "null" : Status.ToString())}"); + toStringOutput.Add($"MediaUrl = {(MediaUrl == null ? "null" : MediaUrl == string.Empty ? "" : MediaUrl)}"); + toStringOutput.Add($"Transcription = {(Transcription == null ? "null" : Transcription.ToString())}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is RecordingMetadataResponse other && + ((ApplicationId == null && other.ApplicationId == null) || (ApplicationId?.Equals(other.ApplicationId) == true)) && + ((AccountId == null && other.AccountId == null) || (AccountId?.Equals(other.AccountId) == true)) && + ((CallId == null && other.CallId == null) || (CallId?.Equals(other.CallId) == true)) && + ((ParentCallId == null && other.ParentCallId == null) || (ParentCallId?.Equals(other.ParentCallId) == true)) && + ((RecordingId == null && other.RecordingId == null) || (RecordingId?.Equals(other.RecordingId) == true)) && + ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && + ((From == null && other.From == null) || (From?.Equals(other.From) == true)) && + ((TransferCallerId == null && other.TransferCallerId == null) || (TransferCallerId?.Equals(other.TransferCallerId) == true)) && + ((TransferTo == null && other.TransferTo == null) || (TransferTo?.Equals(other.TransferTo) == true)) && + ((Duration == null && other.Duration == null) || (Duration?.Equals(other.Duration) == true)) && + ((Direction == null && other.Direction == null) || (Direction?.Equals(other.Direction) == true)) && + ((Channels == null && other.Channels == null) || (Channels?.Equals(other.Channels) == true)) && + ((StartTime == null && other.StartTime == null) || (StartTime?.Equals(other.StartTime) == true)) && + ((EndTime == null && other.EndTime == null) || (EndTime?.Equals(other.EndTime) == true)) && + ((FileFormat == null && other.FileFormat == null) || (FileFormat?.Equals(other.FileFormat) == true)) && + ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true)) && + ((MediaUrl == null && other.MediaUrl == null) || (MediaUrl?.Equals(other.MediaUrl) == true)) && + ((Transcription == null && other.Transcription == null) || (Transcription?.Equals(other.Transcription) == true)); + } + + public override int GetHashCode() + { + int hashCode = 1403073460; + + if (ApplicationId != null) + { + hashCode += ApplicationId.GetHashCode(); + } + + if (AccountId != null) + { + hashCode += AccountId.GetHashCode(); + } + + if (CallId != null) + { + hashCode += CallId.GetHashCode(); + } + + if (ParentCallId != null) + { + hashCode += ParentCallId.GetHashCode(); + } + + if (RecordingId != null) + { + hashCode += RecordingId.GetHashCode(); + } + + if (To != null) + { + hashCode += To.GetHashCode(); + } + + if (From != null) + { + hashCode += From.GetHashCode(); + } + + if (TransferCallerId != null) + { + hashCode += TransferCallerId.GetHashCode(); + } + + if (TransferTo != null) + { + hashCode += TransferTo.GetHashCode(); + } + + if (Duration != null) + { + hashCode += Duration.GetHashCode(); + } + + if (Direction != null) + { + hashCode += Direction.GetHashCode(); + } + + if (Channels != null) + { + hashCode += Channels.GetHashCode(); + } + + if (StartTime != null) + { + hashCode += StartTime.GetHashCode(); + } + + if (EndTime != null) + { + hashCode += EndTime.GetHashCode(); + } + + if (FileFormat != null) + { + hashCode += FileFormat.GetHashCode(); + } + + if (Status != null) + { + hashCode += Status.GetHashCode(); + } + + if (MediaUrl != null) + { + hashCode += MediaUrl.GetHashCode(); + } + + if (Transcription != null) + { + hashCode += Transcription.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/Transcript.cs b/Bandwidth.Standard/Voice/Models/Transcript.cs index 607be6e9..9bec21bb 100644 --- a/Bandwidth.Standard/Voice/Models/Transcript.cs +++ b/Bandwidth.Standard/Voice/Models/Transcript.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -40,5 +41,54 @@ public Transcript(string text = null, [JsonProperty("confidence", NullValueHandling = NullValueHandling.Ignore)] public double? Confidence { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"Transcript : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Text = {(Text == null ? "null" : Text == string.Empty ? "" : Text)}"); + toStringOutput.Add($"Confidence = {(Confidence == null ? "null" : Confidence.ToString())}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is Transcript other && + ((Text == null && other.Text == null) || (Text?.Equals(other.Text) == true)) && + ((Confidence == null && other.Confidence == null) || (Confidence?.Equals(other.Confidence) == true)); + } + + public override int GetHashCode() + { + int hashCode = 866752038; + + if (Text != null) + { + hashCode += Text.GetHashCode(); + } + + if (Confidence != null) + { + hashCode += Confidence.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/Transcription.cs b/Bandwidth.Standard/Voice/Models/Transcription.cs index 57e64c70..fb58d00b 100644 --- a/Bandwidth.Standard/Voice/Models/Transcription.cs +++ b/Bandwidth.Standard/Voice/Models/Transcription.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -56,5 +57,68 @@ public Transcription(string id = null, [JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)] public string Url { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"Transcription : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}"); + toStringOutput.Add($"Status = {(Status == null ? "null" : Status.ToString())}"); + toStringOutput.Add($"CompletedTime = {(CompletedTime == null ? "null" : CompletedTime == string.Empty ? "" : CompletedTime)}"); + toStringOutput.Add($"Url = {(Url == null ? "null" : Url == string.Empty ? "" : Url)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is Transcription other && + ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) && + ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true)) && + ((CompletedTime == null && other.CompletedTime == null) || (CompletedTime?.Equals(other.CompletedTime) == true)) && + ((Url == null && other.Url == null) || (Url?.Equals(other.Url) == true)); + } + + public override int GetHashCode() + { + int hashCode = 732808726; + + if (Id != null) + { + hashCode += Id.GetHashCode(); + } + + if (Status != null) + { + hashCode += Status.GetHashCode(); + } + + if (CompletedTime != null) + { + hashCode += CompletedTime.GetHashCode(); + } + + if (Url != null) + { + hashCode += Url.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/TranscriptionResponse.cs b/Bandwidth.Standard/Voice/Models/TranscriptionResponse.cs index 18b1f4e9..4756a479 100644 --- a/Bandwidth.Standard/Voice/Models/TranscriptionResponse.cs +++ b/Bandwidth.Standard/Voice/Models/TranscriptionResponse.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -32,5 +33,47 @@ public TranscriptionResponse(List transcripts = null) [JsonProperty("transcripts", NullValueHandling = NullValueHandling.Ignore)] public List Transcripts { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"TranscriptionResponse : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Transcripts = {(Transcripts == null ? "null" : $"[{ string.Join(", ", Transcripts)} ]")}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is TranscriptionResponse other && + ((Transcripts == null && other.Transcripts == null) || (Transcripts?.Equals(other.Transcripts) == true)); + } + + public override int GetHashCode() + { + int hashCode = -1678227722; + + if (Transcripts != null) + { + hashCode += Transcripts.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/WebRtc/Controllers/APIController.cs b/Bandwidth.Standard/WebRtc/Controllers/APIController.cs index 9ea25adc..3a5b8e98 100644 --- a/Bandwidth.Standard/WebRtc/Controllers/APIController.cs +++ b/Bandwidth.Standard/WebRtc/Controllers/APIController.cs @@ -113,7 +113,7 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorException("Unexpected Error", _context); + throw new ErrorErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -202,7 +202,7 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorException("Unexpected Error", _context); + throw new ErrorErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -289,7 +289,7 @@ public async Task DeleteParticipantAsync(string accountId, string participantId, if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorException("Unexpected Error", _context); + throw new ErrorErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -380,7 +380,7 @@ public async Task DeleteParticipantAsync(string accountId, string participantId, if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorException("Unexpected Error", _context); + throw new ErrorErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -469,7 +469,7 @@ public async Task DeleteParticipantAsync(string accountId, string participantId, if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorException("Unexpected Error", _context); + throw new ErrorErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -556,7 +556,7 @@ public async Task DeleteSessionAsync(string accountId, string sessionId, Cancell if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorException("Unexpected Error", _context); + throw new ErrorErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -642,7 +642,7 @@ public async Task DeleteSessionAsync(string accountId, string sessionId, Cancell if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorException("Unexpected Error", _context); + throw new ErrorErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -748,7 +748,7 @@ public async Task AddParticipantToSessionAsync( if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorException("Unexpected Error", _context); + throw new ErrorErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -837,7 +837,7 @@ public async Task RemoveParticipantFromSessionAsync(string accountId, string par if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorException("Unexpected Error", _context); + throw new ErrorErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -926,7 +926,7 @@ public async Task RemoveParticipantFromSessionAsync(string accountId, string par if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorException("Unexpected Error", _context); + throw new ErrorErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -1037,7 +1037,7 @@ public async Task UpdateParticipantSubscriptionsAsync( if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorException("Unexpected Error", _context); + throw new ErrorErrorException("Unexpected Error", _context); } //handle errors defined at the API level diff --git a/Bandwidth.Standard/WebRtc/Exceptions/ErrorException.cs b/Bandwidth.Standard/WebRtc/Exceptions/ErrorErrorException.cs similarity index 87% rename from Bandwidth.Standard/WebRtc/Exceptions/ErrorException.cs rename to Bandwidth.Standard/WebRtc/Exceptions/ErrorErrorException.cs index 3bf546cd..bf29ebba 100644 --- a/Bandwidth.Standard/WebRtc/Exceptions/ErrorException.cs +++ b/Bandwidth.Standard/WebRtc/Exceptions/ErrorErrorException.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -20,14 +21,14 @@ namespace Bandwidth.Standard.WebRtc.Exceptions { - public class ErrorException : ApiException + public class ErrorErrorException : ApiException { /// /// Initialization constructor /// /// The reason for throwing exception /// The HTTP context that encapsulates request and response objects - public ErrorException(string reason, HttpContext context) + public ErrorErrorException(string reason, HttpContext context) : base(reason, context) { } /// diff --git a/Bandwidth.Standard/WebRtc/Models/AccountsParticipantsResponse.cs b/Bandwidth.Standard/WebRtc/Models/AccountsParticipantsResponse.cs index abd593ec..fe728b07 100644 --- a/Bandwidth.Standard/WebRtc/Models/AccountsParticipantsResponse.cs +++ b/Bandwidth.Standard/WebRtc/Models/AccountsParticipantsResponse.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -41,5 +42,54 @@ public AccountsParticipantsResponse(Models.Participant participant = null, [JsonProperty("token", NullValueHandling = NullValueHandling.Ignore)] public string Token { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"AccountsParticipantsResponse : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Participant = {(Participant == null ? "null" : Participant.ToString())}"); + toStringOutput.Add($"Token = {(Token == null ? "null" : Token == string.Empty ? "" : Token)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is AccountsParticipantsResponse other && + ((Participant == null && other.Participant == null) || (Participant?.Equals(other.Participant) == true)) && + ((Token == null && other.Token == null) || (Token?.Equals(other.Token) == true)); + } + + public override int GetHashCode() + { + int hashCode = -815453959; + + if (Participant != null) + { + hashCode += Participant.GetHashCode(); + } + + if (Token != null) + { + hashCode += Token.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/WebRtc/Models/DeviceApiVersionEnum.cs b/Bandwidth.Standard/WebRtc/Models/DeviceApiVersionEnum.cs new file mode 100644 index 00000000..abdec84a --- /dev/null +++ b/Bandwidth.Standard/WebRtc/Models/DeviceApiVersionEnum.cs @@ -0,0 +1,79 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ +using System; +using System.Linq; +using System.Collections.Generic; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.WebRtc.Models +{ + [JsonConverter(typeof(StringValuedEnumConverter))] + public enum DeviceApiVersionEnum + { + V3, + V2, + } + + /// + /// Helper for the enum type DeviceApiVersionEnum + /// + public static class DeviceApiVersionEnumHelper + { + //string values corresponding the enum elements + private static List stringValues = new List { "v3", "v2" }; + + /// + /// Converts a DeviceApiVersionEnum value to a corresponding string value + /// + /// The DeviceApiVersionEnum value to convert + /// The representative string value + public static string ToValue(DeviceApiVersionEnum enumValue) + { + switch(enumValue) + { + //only valid enum elements can be used + //this is necessary to avoid errors + case DeviceApiVersionEnum.V3: + case DeviceApiVersionEnum.V2: + return stringValues[(int)enumValue]; + + //an invalid enum value was requested + default: + return null; + } + } + + /// + /// Convert a list of DeviceApiVersionEnum values to a list of strings + /// + /// The list of DeviceApiVersionEnum values to convert + /// The list of representative string values + public static List ToValue(List enumValues) + { + if (null == enumValues) + return null; + + return enumValues.Select(eVal => ToValue(eVal)).ToList(); + } + + /// + /// Converts a string value into DeviceApiVersionEnum value + /// + /// The string value to parse + /// The parsed DeviceApiVersionEnum value + public static DeviceApiVersionEnum ParseString(string value) + { + int index = stringValues.IndexOf(value); + if(index < 0) + throw new InvalidCastException(string.Format("Unable to cast value: {0} to type DeviceApiVersionEnum", value)); + + return (DeviceApiVersionEnum) index; + } + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/WebRtc/Models/Error.cs b/Bandwidth.Standard/WebRtc/Models/Error.cs new file mode 100644 index 00000000..c5d95087 --- /dev/null +++ b/Bandwidth.Standard/WebRtc/Models/Error.cs @@ -0,0 +1,90 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.WebRtc.Models +{ + public class Error + { + public Error() { } + + public Error(int code, + string message) + { + Code = code; + Message = message; + } + + /// + /// Getter for code + /// + [JsonProperty("code")] + public int Code { get; set; } + + /// + /// Getter for message + /// + [JsonProperty("message")] + public string Message { get; set; } + + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"Error : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Code = {Code}"); + toStringOutput.Add($"Message = {(Message == null ? "null" : Message == string.Empty ? "" : Message)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is Error other && + Code.Equals(other.Code) && + ((Message == null && other.Message == null) || (Message?.Equals(other.Message) == true)); + } + + public override int GetHashCode() + { + int hashCode = -760548828; + hashCode += Code.GetHashCode(); + + if (Message != null) + { + hashCode += Message.GetHashCode(); + } + + return hashCode; + } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/WebRtc/Models/Participant.cs b/Bandwidth.Standard/WebRtc/Models/Participant.cs index 07107373..1129d783 100644 --- a/Bandwidth.Standard/WebRtc/Models/Participant.cs +++ b/Bandwidth.Standard/WebRtc/Models/Participant.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -26,7 +27,8 @@ public Participant(string id = null, List publishPermissions = null, List sessions = null, Models.Subscriptions subscriptions = null, - string tag = null) + string tag = null, + Models.DeviceApiVersionEnum? deviceApiVersion = Models.DeviceApiVersionEnum.V2) { Id = id; CallbackUrl = callbackUrl; @@ -34,6 +36,7 @@ public Participant(string id = null, Sessions = sessions; Subscriptions = subscriptions; Tag = tag; + DeviceApiVersion = deviceApiVersion; } /// @@ -73,5 +76,95 @@ public Participant(string id = null, [JsonProperty("tag", NullValueHandling = NullValueHandling.Ignore)] public string Tag { get; set; } + /// + /// Optional field to define the device api version of this participant + /// + [JsonProperty("deviceApiVersion", ItemConverterType = typeof(StringValuedEnumConverter), NullValueHandling = NullValueHandling.Ignore)] + public Models.DeviceApiVersionEnum? DeviceApiVersion { get; set; } + + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"Participant : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}"); + toStringOutput.Add($"CallbackUrl = {(CallbackUrl == null ? "null" : CallbackUrl == string.Empty ? "" : CallbackUrl)}"); + toStringOutput.Add($"PublishPermissions = {(PublishPermissions == null ? "null" : $"[{ string.Join(", ", PublishPermissions)} ]")}"); + toStringOutput.Add($"Sessions = {(Sessions == null ? "null" : $"[{ string.Join(", ", Sessions)} ]")}"); + toStringOutput.Add($"Subscriptions = {(Subscriptions == null ? "null" : Subscriptions.ToString())}"); + toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); + toStringOutput.Add($"DeviceApiVersion = {(DeviceApiVersion == null ? "null" : DeviceApiVersion.ToString())}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is Participant other && + ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) && + ((CallbackUrl == null && other.CallbackUrl == null) || (CallbackUrl?.Equals(other.CallbackUrl) == true)) && + ((PublishPermissions == null && other.PublishPermissions == null) || (PublishPermissions?.Equals(other.PublishPermissions) == true)) && + ((Sessions == null && other.Sessions == null) || (Sessions?.Equals(other.Sessions) == true)) && + ((Subscriptions == null && other.Subscriptions == null) || (Subscriptions?.Equals(other.Subscriptions) == true)) && + ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)) && + ((DeviceApiVersion == null && other.DeviceApiVersion == null) || (DeviceApiVersion?.Equals(other.DeviceApiVersion) == true)); + } + + public override int GetHashCode() + { + int hashCode = -1308942381; + + if (Id != null) + { + hashCode += Id.GetHashCode(); + } + + if (CallbackUrl != null) + { + hashCode += CallbackUrl.GetHashCode(); + } + + if (PublishPermissions != null) + { + hashCode += PublishPermissions.GetHashCode(); + } + + if (Sessions != null) + { + hashCode += Sessions.GetHashCode(); + } + + if (Subscriptions != null) + { + hashCode += Subscriptions.GetHashCode(); + } + + if (Tag != null) + { + hashCode += Tag.GetHashCode(); + } + + if (DeviceApiVersion != null) + { + hashCode += DeviceApiVersion.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/WebRtc/Models/ParticipantSubscription.cs b/Bandwidth.Standard/WebRtc/Models/ParticipantSubscription.cs index b96651f2..ee7c72c9 100644 --- a/Bandwidth.Standard/WebRtc/Models/ParticipantSubscription.cs +++ b/Bandwidth.Standard/WebRtc/Models/ParticipantSubscription.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -32,5 +33,47 @@ public ParticipantSubscription(string participantId) [JsonProperty("participantId")] public string ParticipantId { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"ParticipantSubscription : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"ParticipantId = {(ParticipantId == null ? "null" : ParticipantId == string.Empty ? "" : ParticipantId)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is ParticipantSubscription other && + ((ParticipantId == null && other.ParticipantId == null) || (ParticipantId?.Equals(other.ParticipantId) == true)); + } + + public override int GetHashCode() + { + int hashCode = 1364424941; + + if (ParticipantId != null) + { + hashCode += ParticipantId.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/WebRtc/Models/Session.cs b/Bandwidth.Standard/WebRtc/Models/Session.cs index 97a99a14..2e921ea0 100644 --- a/Bandwidth.Standard/WebRtc/Models/Session.cs +++ b/Bandwidth.Standard/WebRtc/Models/Session.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -40,5 +41,54 @@ public Session(string id = null, [JsonProperty("tag", NullValueHandling = NullValueHandling.Ignore)] public string Tag { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"Session : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}"); + toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is Session other && + ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) && + ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)); + } + + public override int GetHashCode() + { + int hashCode = -256734511; + + if (Id != null) + { + hashCode += Id.GetHashCode(); + } + + if (Tag != null) + { + hashCode += Tag.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Standard/WebRtc/Models/Subscriptions.cs b/Bandwidth.Standard/WebRtc/Models/Subscriptions.cs index a2ad2b67..5e10fd8e 100644 --- a/Bandwidth.Standard/WebRtc/Models/Subscriptions.cs +++ b/Bandwidth.Standard/WebRtc/Models/Subscriptions.cs @@ -3,6 +3,7 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ + using System; using System.IO; using System.Collections.Generic; @@ -41,5 +42,54 @@ public Subscriptions(string sessionId, [JsonProperty("participants", NullValueHandling = NullValueHandling.Ignore)] public List Participants { get; set; } + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"Subscriptions : ({string.Join(", ", toStringOutput)})"; + } + + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"SessionId = {(SessionId == null ? "null" : SessionId == string.Empty ? "" : SessionId)}"); + toStringOutput.Add($"Participants = {(Participants == null ? "null" : $"[{ string.Join(", ", Participants)} ]")}"); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + + return obj is Subscriptions other && + ((SessionId == null && other.SessionId == null) || (SessionId?.Equals(other.SessionId) == true)) && + ((Participants == null && other.Participants == null) || (Participants?.Equals(other.Participants) == true)); + } + + public override int GetHashCode() + { + int hashCode = -1970062954; + + if (SessionId != null) + { + hashCode += SessionId.GetHashCode(); + } + + if (Participants != null) + { + hashCode += Participants.GetHashCode(); + } + + return hashCode; + } + } } \ No newline at end of file diff --git a/Bandwidth.Tests/Messaging/APIControllerTest.cs b/Bandwidth.Tests/Messaging/APIControllerTest.cs index dc86abcf..60ad7c40 100644 --- a/Bandwidth.Tests/Messaging/APIControllerTest.cs +++ b/Bandwidth.Tests/Messaging/APIControllerTest.cs @@ -44,7 +44,7 @@ public void SetUpDerived() public async Task TestTestListMedia() { // Parameters for the API call - string userId = "900000"; + string accountId = "900000"; string continuationToken = "12345"; // Perform API call @@ -52,7 +52,7 @@ public async Task TestTestListMedia() try { - result = await controller.ListMediaAsync(userId, continuationToken); + result = await controller.ListMediaAsync(accountId, continuationToken); } catch(ApiException) {} @@ -77,7 +77,7 @@ public async Task TestTestListMedia() public async Task TestTestGetMedia() { // Parameters for the API call - string userId = "900000"; + string accountId = "900000"; string mediaId = "0a610655-ba58"; // Perform API call @@ -85,7 +85,7 @@ public async Task TestTestGetMedia() try { - result = await controller.GetMediaAsync(userId, mediaId); + result = await controller.GetMediaAsync(accountId, mediaId); } catch(ApiException) {} @@ -110,14 +110,14 @@ public async Task TestTestGetMedia() public async Task TestTestDeleteMedia() { // Parameters for the API call - string userId = "900000"; + string accountId = "900000"; string mediaId = "tjdla-4562ld"; // Perform API call try { - await controller.DeleteMediaAsync(userId, mediaId); + await controller.DeleteMediaAsync(accountId, mediaId); } catch(ApiException) {} @@ -134,7 +134,7 @@ public async Task TestTestDeleteMedia() public async Task TestTestGetMessages() { // Parameters for the API call - string userId = "900000"; + string accountId = "900000"; string messageId = "9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6"; string sourceTn = "%2B15554443333"; string destinationTn = "%2B15554443333"; @@ -150,7 +150,7 @@ public async Task TestTestGetMessages() try { - result = await controller.GetMessagesAsync(userId, messageId, sourceTn, destinationTn, messageStatus, errorCode, fromDateTime, toDateTime, pageToken, limit); + result = await controller.GetMessagesAsync(accountId, messageId, sourceTn, destinationTn, messageStatus, errorCode, fromDateTime, toDateTime, pageToken, limit); } catch(ApiException) {} diff --git a/Bandwidth.sln b/Bandwidth.sln index aa178b91..6af6a5e0 100644 --- a/Bandwidth.sln +++ b/Bandwidth.sln @@ -2,9 +2,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26430.14 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Standard", "Bandwidth.Standard/Bandwidth.Standard.csproj", "{46a9d15b-749f-41bb-8321-58e4e1274a15}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Standard", "Bandwidth.Standard/Bandwidth.Standard.csproj", "{92456a14-19a8-4a39-b80d-4c0135acd222}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Tests", "Bandwidth.Tests/Bandwidth.Tests.csproj", "{8e40b91a-7b00-47b9-abbe-8307d4299fe3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Tests", "Bandwidth.Tests/Bandwidth.Tests.csproj", "{309d88f6-32d3-4d5e-a798-fff2991333ae}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -12,14 +12,14 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {46a9d15b-749f-41bb-8321-58e4e1274a15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {46a9d15b-749f-41bb-8321-58e4e1274a15}.Debug|Any CPU.Build.0 = Debug|Any CPU - {46a9d15b-749f-41bb-8321-58e4e1274a15}.Release|Any CPU.ActiveCfg = Release|Any CPU - {46a9d15b-749f-41bb-8321-58e4e1274a15}.Release|Any CPU.Build.0 = Release|Any CPU - {8e40b91a-7b00-47b9-abbe-8307d4299fe3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8e40b91a-7b00-47b9-abbe-8307d4299fe3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8e40b91a-7b00-47b9-abbe-8307d4299fe3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8e40b91a-7b00-47b9-abbe-8307d4299fe3}.Release|Any CPU.Build.0 = Release|Any CPU + {92456a14-19a8-4a39-b80d-4c0135acd222}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {92456a14-19a8-4a39-b80d-4c0135acd222}.Debug|Any CPU.Build.0 = Debug|Any CPU + {92456a14-19a8-4a39-b80d-4c0135acd222}.Release|Any CPU.ActiveCfg = Release|Any CPU + {92456a14-19a8-4a39-b80d-4c0135acd222}.Release|Any CPU.Build.0 = Release|Any CPU + {309d88f6-32d3-4d5e-a798-fff2991333ae}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {309d88f6-32d3-4d5e-a798-fff2991333ae}.Debug|Any CPU.Build.0 = Debug|Any CPU + {309d88f6-32d3-4d5e-a798-fff2991333ae}.Release|Any CPU.ActiveCfg = Release|Any CPU + {309d88f6-32d3-4d5e-a798-fff2991333ae}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 0e260b9a6c874ac232df8a0f2ee4c73e9e505aa3 Mon Sep 17 00:00:00 2001 From: jmulford-bandwidth Date: Tue, 9 Mar 2021 15:04:51 -0500 Subject: [PATCH 2/4] reverted to webrtc changes only --- ... => ITwoFactorAuthBasicAuthCredentials.cs} | 2 +- ...er.cs => TwoFactorAuthBasicAuthManager.cs} | 4 +- Bandwidth.Standard/Bandwidth.Standard.csproj | 8 +- Bandwidth.Standard/BandwidthClient.cs | 66 ++--- .../Http/Client/HttpClientConfiguration.cs | 6 - Bandwidth.Standard/Http/Client/HttpContext.cs | 6 - .../Http/Request/HttpRequest.cs | 13 - .../Http/Response/HttpResponse.cs | 8 - .../Http/Response/HttpStringResponse.cs | 9 +- Bandwidth.Standard/IConfiguration.cs | 4 +- .../Messaging/Controllers/APIController.cs | 165 ++++++------ ...rrorException.cs => MessagingException.cs} | 5 +- .../Models/BandwidthCallbackMessage.cs | 78 ------ .../Messaging/Models/BandwidthMessage.cs | 120 --------- .../Messaging/Models/BandwidthMessageItem.cs | 113 -------- .../Messaging/Models/BandwidthMessagesList.cs | 57 ---- .../Messaging/Models/DeferredResult.cs | 50 ---- Bandwidth.Standard/Messaging/Models/Media.cs | 117 ++++---- .../Messaging/Models/MessageRequest.cs | 85 ------ .../Messaging/Models/MessagingException.cs | 94 ------- .../Messaging/Models/PageInfo.cs | 64 ----- Bandwidth.Standard/Messaging/Models/Tag.cs | 50 ---- .../Models/ErrorWithRequest.cs | 94 ------- .../Models/ForbiddenRequest.cs | 79 ------ .../Models/TwoFactorCodeRequestSchema.cs | 150 ----------- .../Models/TwoFactorMessagingResponse.cs | 79 ------ .../Models/TwoFactorVerifyCodeResponse.cs | 79 ------ .../Models/TwoFactorVerifyRequestSchema.cs | 135 ---------- .../Models/TwoFactorVoiceResponse.cs | 79 ------ .../Models/UnauthorizedRequest.cs | 79 ------ Bandwidth.Standard/Server.cs | 2 +- .../Controllers/MFAController.cs | 42 +-- .../Exceptions/ErrorWithRequestException.cs} | 9 +- .../Exceptions/ForbiddenRequestException.cs} | 9 +- .../UnauthorizedRequestException.cs} | 9 +- .../Models/TwoFactorCodeRequestSchema.cs | 76 ++++++ .../Models/TwoFactorMessagingResponse.cs | 36 +++ .../Models/TwoFactorVerifyCodeResponse.cs | 36 +++ .../Models/TwoFactorVerifyRequestSchema.cs | 68 +++++ .../Models/TwoFactorVoiceResponse.cs | 36 +++ .../TwoFactorAuthClient.cs} | 8 +- .../Voice/Controllers/APIController.cs | 254 +++++++++--------- .../Exceptions/ApiErrorResponseException.cs | 52 ++++ .../Voice/Models/ApiCallResponse.cs | 168 ------------ .../Voice/Models/ApiCallStateResponse.cs | 171 ------------ .../Voice/Models/ApiCreateCallRequest.cs | 169 ------------ .../Voice/Models/ApiErrorResponse.cs | 109 -------- .../Voice/Models/ApiModifyCallRequest.cs | 106 -------- .../Models/ApiModifyConferenceRequest.cs | 99 ------- .../Models/ApiTranscribeRecordingRequest.cs | 78 ------ .../Voice/Models/ConferenceDetail.cs | 92 ------- .../Voice/Models/ConferenceMemberDetail.cs | 78 ------ .../ConferenceRecordingMetadataResponse.cs | 113 -------- .../Voice/Models/ModifyCallRecordingState.cs | 39 --- .../Voice/Models/RecordingMetadataResponse.cs | 162 ----------- Bandwidth.Standard/Voice/Models/Transcript.cs | 50 ---- .../Voice/Models/Transcription.cs | 64 ----- .../Voice/Models/TranscriptionResponse.cs | 43 --- .../WebRtc/Controllers/APIController.cs | 22 +- ...rorErrorException.cs => ErrorException.cs} | 5 +- .../Models/AccountsParticipantsResponse.cs | 50 ---- Bandwidth.Standard/WebRtc/Models/Error.cs | 90 ------- .../WebRtc/Models/Participant.cs | 93 +------ .../WebRtc/Models/ParticipantSubscription.cs | 43 --- Bandwidth.Standard/WebRtc/Models/Session.cs | 50 ---- .../WebRtc/Models/Subscriptions.cs | 50 ---- .../Messaging/APIControllerTest.cs | 16 +- 67 files changed, 675 insertions(+), 3820 deletions(-) rename Bandwidth.Standard/Authentication/{IMultiFactorAuthBasicAuthCredentials.cs => ITwoFactorAuthBasicAuthCredentials.cs} (89%) rename Bandwidth.Standard/Authentication/{MultiFactorAuthBasicAuthManager.cs => TwoFactorAuthBasicAuthManager.cs} (92%) rename Bandwidth.Standard/Messaging/Exceptions/{MessagingExceptionErrorException.cs => MessagingException.cs} (85%) delete mode 100644 Bandwidth.Standard/Messaging/Models/MessagingException.cs delete mode 100644 Bandwidth.Standard/MultiFactorAuth/Models/ErrorWithRequest.cs delete mode 100644 Bandwidth.Standard/MultiFactorAuth/Models/ForbiddenRequest.cs delete mode 100644 Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorCodeRequestSchema.cs delete mode 100644 Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorMessagingResponse.cs delete mode 100644 Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVerifyCodeResponse.cs delete mode 100644 Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVerifyRequestSchema.cs delete mode 100644 Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVoiceResponse.cs delete mode 100644 Bandwidth.Standard/MultiFactorAuth/Models/UnauthorizedRequest.cs rename Bandwidth.Standard/{MultiFactorAuth => TwoFactorAuth}/Controllers/MFAController.cs (82%) rename Bandwidth.Standard/{MultiFactorAuth/Exceptions/ErrorWithRequestErrorException.cs => TwoFactorAuth/Exceptions/ErrorWithRequestException.cs} (80%) rename Bandwidth.Standard/{MultiFactorAuth/Exceptions/ForbiddenRequestErrorException.cs => TwoFactorAuth/Exceptions/ForbiddenRequestException.cs} (78%) rename Bandwidth.Standard/{MultiFactorAuth/Exceptions/UnauthorizedRequestErrorException.cs => TwoFactorAuth/Exceptions/UnauthorizedRequestException.cs} (77%) create mode 100644 Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorCodeRequestSchema.cs create mode 100644 Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorMessagingResponse.cs create mode 100644 Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVerifyCodeResponse.cs create mode 100644 Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVerifyRequestSchema.cs create mode 100644 Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVoiceResponse.cs rename Bandwidth.Standard/{MultiFactorAuth/MultiFactorAuthClient.cs => TwoFactorAuth/TwoFactorAuthClient.cs} (78%) create mode 100644 Bandwidth.Standard/Voice/Exceptions/ApiErrorResponseException.cs delete mode 100644 Bandwidth.Standard/Voice/Models/ApiErrorResponse.cs rename Bandwidth.Standard/WebRtc/Exceptions/{ErrorErrorException.cs => ErrorException.cs} (87%) delete mode 100644 Bandwidth.Standard/WebRtc/Models/Error.cs diff --git a/Bandwidth.Standard/Authentication/IMultiFactorAuthBasicAuthCredentials.cs b/Bandwidth.Standard/Authentication/ITwoFactorAuthBasicAuthCredentials.cs similarity index 89% rename from Bandwidth.Standard/Authentication/IMultiFactorAuthBasicAuthCredentials.cs rename to Bandwidth.Standard/Authentication/ITwoFactorAuthBasicAuthCredentials.cs index 04c245c3..2dabfe2a 100644 --- a/Bandwidth.Standard/Authentication/IMultiFactorAuthBasicAuthCredentials.cs +++ b/Bandwidth.Standard/Authentication/ITwoFactorAuthBasicAuthCredentials.cs @@ -2,7 +2,7 @@ namespace Bandwidth.Standard.Authentication { - public interface IMultiFactorAuthBasicAuthCredentials + public interface ITwoFactorAuthBasicAuthCredentials { /// /// Getter for basicAuthUserName diff --git a/Bandwidth.Standard/Authentication/MultiFactorAuthBasicAuthManager.cs b/Bandwidth.Standard/Authentication/TwoFactorAuthBasicAuthManager.cs similarity index 92% rename from Bandwidth.Standard/Authentication/MultiFactorAuthBasicAuthManager.cs rename to Bandwidth.Standard/Authentication/TwoFactorAuthBasicAuthManager.cs index 09e95bf5..bd51aa37 100644 --- a/Bandwidth.Standard/Authentication/MultiFactorAuthBasicAuthManager.cs +++ b/Bandwidth.Standard/Authentication/TwoFactorAuthBasicAuthManager.cs @@ -6,12 +6,12 @@ namespace Bandwidth.Standard.Authentication { - internal class MultiFactorAuthBasicAuthManager : IMultiFactorAuthBasicAuthCredentials, IAuthManager + internal class TwoFactorAuthBasicAuthManager : ITwoFactorAuthBasicAuthCredentials, IAuthManager { /// /// Constructor /// - public MultiFactorAuthBasicAuthManager(string username, string password) + public TwoFactorAuthBasicAuthManager(string username, string password) { BasicAuthUserName = username; BasicAuthPassword = password; diff --git a/Bandwidth.Standard/Bandwidth.Standard.csproj b/Bandwidth.Standard/Bandwidth.Standard.csproj index 180390be..bd27a1a3 100644 --- a/Bandwidth.Standard/Bandwidth.Standard.csproj +++ b/Bandwidth.Standard/Bandwidth.Standard.csproj @@ -9,13 +9,13 @@ netstandard1.3 Bandwidth.Sdk - 1.0.0.0 + 5.1.0.0 Bandwidth.Standard Copyright © 2019 - 1.0.0.0 - 1.0.0.0 + 5.1.0.0 + 5.1.0.0 .NET client library for the bandwidth API 7.3 @@ -28,4 +28,4 @@ - \ No newline at end of file + diff --git a/Bandwidth.Standard/BandwidthClient.cs b/Bandwidth.Standard/BandwidthClient.cs index 1eb3a56a..37404c80 100644 --- a/Bandwidth.Standard/BandwidthClient.cs +++ b/Bandwidth.Standard/BandwidthClient.cs @@ -11,7 +11,7 @@ using Bandwidth.Standard.Authentication; using Bandwidth.Standard.Http.Client; using Bandwidth.Standard.Messaging; -using Bandwidth.Standard.MultiFactorAuth; +using Bandwidth.Standard.TwoFactorAuth; using Bandwidth.Standard.Voice; using Bandwidth.Standard.WebRtc; @@ -29,11 +29,11 @@ public sealed class BandwidthClient: IConfiguration internal readonly IHttpClient httpClient; internal readonly HttpCallBack httpCallBack; private readonly MessagingBasicAuthManager messagingBasicAuthManager; - private readonly MultiFactorAuthBasicAuthManager multiFactorAuthBasicAuthManager; + private readonly TwoFactorAuthBasicAuthManager twoFactorAuthBasicAuthManager; private readonly VoiceBasicAuthManager voiceBasicAuthManager; private readonly WebRtcBasicAuthManager webRtcBasicAuthManager; private readonly Lazy messaging; - private readonly Lazy multiFactorAuth; + private readonly Lazy twoFactorAuth; private readonly Lazy voice; private readonly Lazy webRtc; @@ -43,9 +43,9 @@ public sealed class BandwidthClient: IConfiguration public MessagingClient Messaging => messaging.Value; /// - /// Provides access to MultiFactorAuthClient controller. + /// Provides access to TwoFactorAuthClient controller. /// - public MultiFactorAuthClient MultiFactorAuth => multiFactorAuth.Value; + public TwoFactorAuthClient TwoFactorAuth => twoFactorAuth.Value; /// /// Provides access to VoiceClient controller. @@ -66,8 +66,8 @@ internal static BandwidthClient CreateFromEnvironment() string baseUrl = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_BASE_URL"); string messagingBasicAuthUserName = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_MESSAGING_BASIC_AUTH_USER_NAME"); string messagingBasicAuthPassword = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_MESSAGING_BASIC_AUTH_PASSWORD"); - string multiFactorAuthBasicAuthUserName = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_MULTI_FACTOR_AUTH_BASIC_AUTH_USER_NAME"); - string multiFactorAuthBasicAuthPassword = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_MULTI_FACTOR_AUTH_BASIC_AUTH_PASSWORD"); + string twoFactorAuthBasicAuthUserName = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_TWO_FACTOR_AUTH_BASIC_AUTH_USER_NAME"); + string twoFactorAuthBasicAuthPassword = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_TWO_FACTOR_AUTH_BASIC_AUTH_PASSWORD"); string voiceBasicAuthUserName = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_VOICE_BASIC_AUTH_USER_NAME"); string voiceBasicAuthPassword = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_VOICE_BASIC_AUTH_PASSWORD"); string webRtcBasicAuthUserName = System.Environment.GetEnvironmentVariable("BANDWIDTH_STANDARD_WEB_RTC_BASIC_AUTH_USER_NAME"); @@ -93,9 +93,9 @@ internal static BandwidthClient CreateFromEnvironment() builder.MessagingBasicAuthCredentials(messagingBasicAuthUserName, messagingBasicAuthPassword); } - if (multiFactorAuthBasicAuthUserName != null && multiFactorAuthBasicAuthPassword != null) + if (twoFactorAuthBasicAuthUserName != null && twoFactorAuthBasicAuthPassword != null) { - builder.MultiFactorAuthBasicAuthCredentials(multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword); + builder.TwoFactorAuthBasicAuthCredentials(twoFactorAuthBasicAuthUserName, twoFactorAuthBasicAuthPassword); } if (voiceBasicAuthUserName != null && voiceBasicAuthPassword != null) @@ -113,7 +113,7 @@ internal static BandwidthClient CreateFromEnvironment() private BandwidthClient(TimeSpan timeout, Environment environment, string baseUrl, string messagingBasicAuthUserName, string messagingBasicAuthPassword, - string multiFactorAuthBasicAuthUserName, string multiFactorAuthBasicAuthPassword, + string twoFactorAuthBasicAuthUserName, string twoFactorAuthBasicAuthPassword, string voiceBasicAuthUserName, string voiceBasicAuthPassword, string webRtcBasicAuthUserName, string webRtcBasicAuthPassword, IDictionary authManagers, IHttpClient httpClient, @@ -139,16 +139,16 @@ private BandwidthClient(TimeSpan timeout, Environment environment, string baseUr this.authManagers["messaging"] = messagingBasicAuthManager; } - if (this.authManagers.ContainsKey("multiFactorAuth")) + if (this.authManagers.ContainsKey("twoFactorAuth")) { - multiFactorAuthBasicAuthManager = (MultiFactorAuthBasicAuthManager) this.authManagers["multiFactorAuth"]; + twoFactorAuthBasicAuthManager = (TwoFactorAuthBasicAuthManager) this.authManagers["twoFactorAuth"]; } - if (!this.authManagers.ContainsKey("multiFactorAuth") - || !MultiFactorAuthBasicAuthCredentials.Equals(multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword)) + if (!this.authManagers.ContainsKey("twoFactorAuth") + || !TwoFactorAuthBasicAuthCredentials.Equals(twoFactorAuthBasicAuthUserName, twoFactorAuthBasicAuthPassword)) { - multiFactorAuthBasicAuthManager = new MultiFactorAuthBasicAuthManager(multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword); - this.authManagers["multiFactorAuth"] = multiFactorAuthBasicAuthManager; + twoFactorAuthBasicAuthManager = new TwoFactorAuthBasicAuthManager(twoFactorAuthBasicAuthUserName, twoFactorAuthBasicAuthPassword); + this.authManagers["twoFactorAuth"] = twoFactorAuthBasicAuthManager; } if (this.authManagers.ContainsKey("voice")) @@ -176,7 +176,7 @@ private BandwidthClient(TimeSpan timeout, Environment environment, string baseUr } messaging = new Lazy(() => new MessagingClient(this)); - multiFactorAuth = new Lazy(() => new MultiFactorAuthClient(this)); + twoFactorAuth = new Lazy(() => new TwoFactorAuthClient(this)); voice = new Lazy(() => new VoiceClient(this)); webRtc = new Lazy(() => new WebRtcClient(this)); } @@ -192,9 +192,9 @@ private BandwidthClient(TimeSpan timeout, Environment environment, string baseUr public IMessagingBasicAuthCredentials MessagingBasicAuthCredentials { get => messagingBasicAuthManager; } /// - /// The credentials to use with MultiFactorAuthBasicAuth + /// The credentials to use with TwoFactorAuthBasicAuth /// - public IMultiFactorAuthBasicAuthCredentials MultiFactorAuthBasicAuthCredentials { get => multiFactorAuthBasicAuthManager; } + public ITwoFactorAuthBasicAuthCredentials TwoFactorAuthBasicAuthCredentials { get => twoFactorAuthBasicAuthManager; } /// /// The credentials to use with VoiceBasicAuth @@ -230,7 +230,7 @@ private BandwidthClient(TimeSpan timeout, Environment environment, string baseUr { { Server.Default, "api.bandwidth.com" }, { Server.MessagingDefault, "https://messaging.bandwidth.com/api/v2" }, - { Server.MultiFactorAuthDefault, "https://mfa.bandwidth.com/api/v1" }, + { Server.TwoFactorAuthDefault, "https://mfa.bandwidth.com/api/v1" }, { Server.VoiceDefault, "https://voice.bandwidth.com" }, { Server.WebRtcDefault, "https://api.webrtc.bandwidth.com/v1" }, } @@ -240,7 +240,7 @@ private BandwidthClient(TimeSpan timeout, Environment environment, string baseUr { { Server.Default, "{base_url}" }, { Server.MessagingDefault, "{base_url}" }, - { Server.MultiFactorAuthDefault, "{base_url}" }, + { Server.TwoFactorAuthDefault, "{base_url}" }, { Server.VoiceDefault, "{base_url}" }, { Server.WebRtcDefault, "{base_url}" }, } @@ -283,7 +283,7 @@ public Builder ToBuilder() .Environment(Environment) .BaseUrl(BaseUrl) .MessagingBasicAuthCredentials(messagingBasicAuthManager.BasicAuthUserName, messagingBasicAuthManager.BasicAuthPassword) - .MultiFactorAuthBasicAuthCredentials(multiFactorAuthBasicAuthManager.BasicAuthUserName, multiFactorAuthBasicAuthManager.BasicAuthPassword) + .TwoFactorAuthBasicAuthCredentials(twoFactorAuthBasicAuthManager.BasicAuthUserName, twoFactorAuthBasicAuthManager.BasicAuthPassword) .VoiceBasicAuthCredentials(voiceBasicAuthManager.BasicAuthUserName, voiceBasicAuthManager.BasicAuthPassword) .WebRtcBasicAuthCredentials(webRtcBasicAuthManager.BasicAuthUserName, webRtcBasicAuthManager.BasicAuthPassword) .HttpCallBack(httpCallBack) @@ -293,14 +293,6 @@ public Builder ToBuilder() return builder; } - public override string ToString() - { - return - $"Environment = {Environment}, " + - $"BaseUrl = {BaseUrl}, " + - $"HttpClientConfiguration = {HttpClientConfiguration}, "; - } - public class Builder { private TimeSpan timeout = TimeSpan.FromSeconds(100); @@ -308,8 +300,8 @@ public class Builder private string baseUrl = "https://www.example.com"; private string messagingBasicAuthUserName = "TODO: Replace"; private string messagingBasicAuthPassword = "TODO: Replace"; - private string multiFactorAuthBasicAuthUserName = "TODO: Replace"; - private string multiFactorAuthBasicAuthPassword = "TODO: Replace"; + private string twoFactorAuthBasicAuthUserName = "TODO: Replace"; + private string twoFactorAuthBasicAuthPassword = "TODO: Replace"; private string voiceBasicAuthUserName = "TODO: Replace"; private string voiceBasicAuthPassword = "TODO: Replace"; private string webRtcBasicAuthUserName = "TODO: Replace"; @@ -331,12 +323,12 @@ public Builder MessagingBasicAuthCredentials(string messagingBasicAuthUserName, } /// - /// Credentials setter for MultiFactorAuthBasicAuth + /// Credentials setter for TwoFactorAuthBasicAuth /// - public Builder MultiFactorAuthBasicAuthCredentials(string multiFactorAuthBasicAuthUserName, string multiFactorAuthBasicAuthPassword) + public Builder TwoFactorAuthBasicAuthCredentials(string twoFactorAuthBasicAuthUserName, string twoFactorAuthBasicAuthPassword) { - this.multiFactorAuthBasicAuthUserName = multiFactorAuthBasicAuthUserName ?? throw new ArgumentNullException(nameof(multiFactorAuthBasicAuthUserName)); - this.multiFactorAuthBasicAuthPassword = multiFactorAuthBasicAuthPassword ?? throw new ArgumentNullException(nameof(multiFactorAuthBasicAuthPassword)); + this.twoFactorAuthBasicAuthUserName = twoFactorAuthBasicAuthUserName ?? throw new ArgumentNullException(nameof(twoFactorAuthBasicAuthUserName)); + this.twoFactorAuthBasicAuthPassword = twoFactorAuthBasicAuthPassword ?? throw new ArgumentNullException(nameof(twoFactorAuthBasicAuthPassword)); return this; } @@ -430,7 +422,7 @@ public BandwidthClient Build() } return new BandwidthClient(timeout, environment, baseUrl, messagingBasicAuthUserName, messagingBasicAuthPassword, - multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword, voiceBasicAuthUserName, + twoFactorAuthBasicAuthUserName, twoFactorAuthBasicAuthPassword, voiceBasicAuthUserName, voiceBasicAuthPassword, webRtcBasicAuthUserName, webRtcBasicAuthPassword, authManagers, httpClient, httpCallBack, httpClientConfig); } diff --git a/Bandwidth.Standard/Http/Client/HttpClientConfiguration.cs b/Bandwidth.Standard/Http/Client/HttpClientConfiguration.cs index 8202f848..4afe6d92 100644 --- a/Bandwidth.Standard/Http/Client/HttpClientConfiguration.cs +++ b/Bandwidth.Standard/Http/Client/HttpClientConfiguration.cs @@ -16,11 +16,5 @@ public HttpClientConfiguration() /// Http client timeout /// public TimeSpan Timeout { get; internal set; } - - public override string ToString() - { - return "HttpClientConfiguration: " + - $"{Timeout} "; - } } } diff --git a/Bandwidth.Standard/Http/Client/HttpContext.cs b/Bandwidth.Standard/Http/Client/HttpContext.cs index 68babc6a..0094b190 100644 --- a/Bandwidth.Standard/Http/Client/HttpContext.cs +++ b/Bandwidth.Standard/Http/Client/HttpContext.cs @@ -29,11 +29,5 @@ public HttpContext(HttpRequest request, HttpResponse response) Request = request; Response = response; } - - public override string ToString() - { - return $" Request = {Request}, " + - $" Response = {Response}"; - } } } diff --git a/Bandwidth.Standard/Http/Request/HttpRequest.cs b/Bandwidth.Standard/Http/Request/HttpRequest.cs index 7519d9ba..59065f75 100644 --- a/Bandwidth.Standard/Http/Request/HttpRequest.cs +++ b/Bandwidth.Standard/Http/Request/HttpRequest.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using System.Net.Http; -using Bandwidth.Standard.Utilities; namespace Bandwidth.Standard.Http.Request { @@ -139,17 +138,5 @@ public void AddQueryParameters(Dictionary queryParamaters) QueryParameters = QueryParameters.Concat(queryParamaters).ToDictionary(x => x.Key, x => x.Value); } } - - public override string ToString() - { - return $" HttpMethod = {HttpMethod}, " + - $" QueryUrl = {QueryUrl}, " + - $" QueryParameters = {ApiHelper.JsonSerialize(QueryParameters)}, " + - $" Headers = {ApiHelper.JsonSerialize(Headers)}, " + - $" FormParameters = {ApiHelper.JsonSerialize(FormParameters)}, " + - $" Body = {Body}, " + - $" Username = {Username}, " + - $" Password = {Password}"; - } } } diff --git a/Bandwidth.Standard/Http/Response/HttpResponse.cs b/Bandwidth.Standard/Http/Response/HttpResponse.cs index 527d32d4..5ea280bb 100644 --- a/Bandwidth.Standard/Http/Response/HttpResponse.cs +++ b/Bandwidth.Standard/Http/Response/HttpResponse.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.IO; -using Bandwidth.Standard.Utilities; namespace Bandwidth.Standard.Http.Response { @@ -34,12 +33,5 @@ public HttpResponse(int statusCode, Dictionary headers, Stream r this.Headers = headers; this.RawBody = rawBody; } - - public override string ToString() - { - return $" StatusCode = {StatusCode}, " + - $" Headers = {ApiHelper.JsonSerialize(Headers)}, " + - $" RawBody = {RawBody}"; - } } } diff --git a/Bandwidth.Standard/Http/Response/HttpStringResponse.cs b/Bandwidth.Standard/Http/Response/HttpStringResponse.cs index 0d036b7f..c82a3023 100644 --- a/Bandwidth.Standard/Http/Response/HttpStringResponse.cs +++ b/Bandwidth.Standard/Http/Response/HttpStringResponse.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.IO; -using Bandwidth.Standard.Utilities; namespace Bandwidth.Standard.Http.Response { @@ -24,11 +23,5 @@ public HttpStringResponse(int statusCode, Dictionary headers, St { this.Body = body; } - - public override string ToString() - { - return $"Body = {Body}" + - $"{base.ToString()}: "; - } } -} \ No newline at end of file +} diff --git a/Bandwidth.Standard/IConfiguration.cs b/Bandwidth.Standard/IConfiguration.cs index 92b87313..444cd50c 100644 --- a/Bandwidth.Standard/IConfiguration.cs +++ b/Bandwidth.Standard/IConfiguration.cs @@ -26,9 +26,9 @@ public interface IConfiguration IMessagingBasicAuthCredentials MessagingBasicAuthCredentials { get; } /// - /// The credentials to use with MultiFactorAuthBasicAuth + /// The credentials to use with TwoFactorAuthBasicAuth /// - IMultiFactorAuthBasicAuthCredentials MultiFactorAuthBasicAuthCredentials { get; } + ITwoFactorAuthBasicAuthCredentials TwoFactorAuthBasicAuthCredentials { get; } /// /// The credentials to use with VoiceBasicAuth diff --git a/Bandwidth.Standard/Messaging/Controllers/APIController.cs b/Bandwidth.Standard/Messaging/Controllers/APIController.cs index e032902e..3f63dace 100644 --- a/Bandwidth.Standard/Messaging/Controllers/APIController.cs +++ b/Bandwidth.Standard/Messaging/Controllers/APIController.cs @@ -32,12 +32,12 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar /// /// listMedia /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Optional parameter: Continuation token used to retrieve subsequent media. /// Returns the ApiResponse> response from the API call - public ApiResponse> ListMedia(string accountId, string continuationToken = null) + public ApiResponse> ListMedia(string userId, string continuationToken = null) { - Task>> t = ListMediaAsync(accountId, continuationToken); + Task>> t = ListMediaAsync(userId, continuationToken); ApiHelper.RunTaskSynchronously(t); return t.Result; } @@ -45,22 +45,22 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar /// /// listMedia /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Optional parameter: Continuation token used to retrieve subsequent media. /// Returns the ApiResponse> response from the API call - public async Task>> ListMediaAsync(string accountId, string continuationToken = null, CancellationToken cancellationToken = default) + public async Task>> ListMediaAsync(string userId, string continuationToken = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(Server.MessagingDefault); //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); - _queryBuilder.Append("/users/{accountId}/media"); + _queryBuilder.Append("/users/{userId}/media"); //process optional template parameters ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() { - { "accountId", accountId } + { "userId", userId } }); //append request with appropriate headers and parameters @@ -92,32 +92,32 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new MessagingExceptionErrorException("400 Request is malformed or invalid", _context); + throw new MessagingException("400 Request is malformed or invalid", _context); } if (_response.StatusCode == 401) { - throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", _context); + throw new MessagingException("401 The specified user does not have access to the account", _context); } if (_response.StatusCode == 403) { - throw new MessagingExceptionErrorException("403 The user does not have access to this API", _context); + throw new MessagingException("403 The user does not have access to this API", _context); } if (_response.StatusCode == 404) { - throw new MessagingExceptionErrorException("404 Path not found", _context); + throw new MessagingException("404 Path not found", _context); } if (_response.StatusCode == 415) { - throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", _context); + throw new MessagingException("415 The content-type of the request is incorrect", _context); } if (_response.StatusCode == 429) { - throw new MessagingExceptionErrorException("429 The rate limit has been reached", _context); + throw new MessagingException("429 The rate limit has been reached", _context); } //handle errors defined at the API level @@ -131,12 +131,12 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar /// /// getMedia /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Required parameter: Media ID to retrieve /// Returns the ApiResponse response from the API call - public ApiResponse GetMedia(string accountId, string mediaId) + public ApiResponse GetMedia(string userId, string mediaId) { - Task> t = GetMediaAsync(accountId, mediaId); + Task> t = GetMediaAsync(userId, mediaId); ApiHelper.RunTaskSynchronously(t); return t.Result; } @@ -144,22 +144,22 @@ public ApiResponse GetMedia(string accountId, string mediaId) /// /// getMedia /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Required parameter: Media ID to retrieve /// Returns the ApiResponse response from the API call - public async Task> GetMediaAsync(string accountId, string mediaId, CancellationToken cancellationToken = default) + public async Task> GetMediaAsync(string userId, string mediaId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(Server.MessagingDefault); //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); - _queryBuilder.Append("/users/{accountId}/media/{mediaId}"); + _queryBuilder.Append("/users/{userId}/media/{mediaId}"); //process optional template parameters ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() { - { "accountId", accountId }, + { "userId", userId }, { "mediaId", mediaId } }); @@ -190,32 +190,32 @@ public async Task> GetMediaAsync(string accountId, string me //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new MessagingExceptionErrorException("400 Request is malformed or invalid", _context); + throw new MessagingException("400 Request is malformed or invalid", _context); } if (_response.StatusCode == 401) { - throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", _context); + throw new MessagingException("401 The specified user does not have access to the account", _context); } if (_response.StatusCode == 403) { - throw new MessagingExceptionErrorException("403 The user does not have access to this API", _context); + throw new MessagingException("403 The user does not have access to this API", _context); } if (_response.StatusCode == 404) { - throw new MessagingExceptionErrorException("404 Path not found", _context); + throw new MessagingException("404 Path not found", _context); } if (_response.StatusCode == 415) { - throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", _context); + throw new MessagingException("415 The content-type of the request is incorrect", _context); } if (_response.StatusCode == 429) { - throw new MessagingExceptionErrorException("429 The rate limit has been reached", _context); + throw new MessagingException("429 The rate limit has been reached", _context); } //handle errors defined at the API level @@ -229,35 +229,39 @@ public async Task> GetMediaAsync(string accountId, string me /// /// uploadMedia /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Required parameter: The user supplied custom media ID + /// Required parameter: The size of the entity-body /// Required parameter: Example: /// Optional parameter: The media type of the entity-body /// Optional parameter: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. /// Returns the void response from the API call public void UploadMedia( - string accountId, + string userId, string mediaId, + long contentLength, FileStreamInfo body, string contentType = "application/octet-stream", string cacheControl = null) { - Task t = UploadMediaAsync(accountId, mediaId, body, contentType, cacheControl); + Task t = UploadMediaAsync(userId, mediaId, contentLength, body, contentType, cacheControl); ApiHelper.RunTaskSynchronously(t); } /// /// uploadMedia /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Required parameter: The user supplied custom media ID + /// Required parameter: The size of the entity-body /// Required parameter: Example: /// Optional parameter: The media type of the entity-body /// Optional parameter: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. /// Returns the void response from the API call public async Task UploadMediaAsync( - string accountId, + string userId, string mediaId, + long contentLength, FileStreamInfo body, string contentType = "application/octet-stream", string cacheControl = null, CancellationToken cancellationToken = default) @@ -267,12 +271,12 @@ public async Task UploadMediaAsync( //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); - _queryBuilder.Append("/users/{accountId}/media/{mediaId}"); + _queryBuilder.Append("/users/{userId}/media/{mediaId}"); //process optional template parameters ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() { - { "accountId", accountId }, + { "userId", userId }, { "mediaId", mediaId } }); @@ -280,6 +284,7 @@ public async Task UploadMediaAsync( var _headers = new Dictionary() { { "user-agent", userAgent }, + { "Content-Length", contentLength.ToString() }, { "Content-Type", (null != contentType) ? contentType : "application/octet-stream" }, { "Cache-Control", cacheControl } }; @@ -308,32 +313,32 @@ public async Task UploadMediaAsync( //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new MessagingExceptionErrorException("400 Request is malformed or invalid", _context); + throw new MessagingException("400 Request is malformed or invalid", _context); } if (_response.StatusCode == 401) { - throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", _context); + throw new MessagingException("401 The specified user does not have access to the account", _context); } if (_response.StatusCode == 403) { - throw new MessagingExceptionErrorException("403 The user does not have access to this API", _context); + throw new MessagingException("403 The user does not have access to this API", _context); } if (_response.StatusCode == 404) { - throw new MessagingExceptionErrorException("404 Path not found", _context); + throw new MessagingException("404 Path not found", _context); } if (_response.StatusCode == 415) { - throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", _context); + throw new MessagingException("415 The content-type of the request is incorrect", _context); } if (_response.StatusCode == 429) { - throw new MessagingExceptionErrorException("429 The rate limit has been reached", _context); + throw new MessagingException("429 The rate limit has been reached", _context); } //handle errors defined at the API level @@ -344,34 +349,34 @@ public async Task UploadMediaAsync( /// /// deleteMedia /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Required parameter: The media ID to delete /// Returns the void response from the API call - public void DeleteMedia(string accountId, string mediaId) + public void DeleteMedia(string userId, string mediaId) { - Task t = DeleteMediaAsync(accountId, mediaId); + Task t = DeleteMediaAsync(userId, mediaId); ApiHelper.RunTaskSynchronously(t); } /// /// deleteMedia /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Required parameter: The media ID to delete /// Returns the void response from the API call - public async Task DeleteMediaAsync(string accountId, string mediaId, CancellationToken cancellationToken = default) + public async Task DeleteMediaAsync(string userId, string mediaId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(Server.MessagingDefault); //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); - _queryBuilder.Append("/users/{accountId}/media/{mediaId}"); + _queryBuilder.Append("/users/{userId}/media/{mediaId}"); //process optional template parameters ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() { - { "accountId", accountId }, + { "userId", userId }, { "mediaId", mediaId } }); @@ -402,32 +407,32 @@ public async Task DeleteMediaAsync(string accountId, string mediaId, Cancellatio //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new MessagingExceptionErrorException("400 Request is malformed or invalid", _context); + throw new MessagingException("400 Request is malformed or invalid", _context); } if (_response.StatusCode == 401) { - throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", _context); + throw new MessagingException("401 The specified user does not have access to the account", _context); } if (_response.StatusCode == 403) { - throw new MessagingExceptionErrorException("403 The user does not have access to this API", _context); + throw new MessagingException("403 The user does not have access to this API", _context); } if (_response.StatusCode == 404) { - throw new MessagingExceptionErrorException("404 Path not found", _context); + throw new MessagingException("404 Path not found", _context); } if (_response.StatusCode == 415) { - throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", _context); + throw new MessagingException("415 The content-type of the request is incorrect", _context); } if (_response.StatusCode == 429) { - throw new MessagingExceptionErrorException("429 The rate limit has been reached", _context); + throw new MessagingException("429 The rate limit has been reached", _context); } //handle errors defined at the API level @@ -438,11 +443,11 @@ public async Task DeleteMediaAsync(string accountId, string mediaId, Cancellatio /// /// getMessages /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Optional parameter: The ID of the message to search for. Special characters need to be encoded using URL encoding /// Optional parameter: The phone number that sent the message /// Optional parameter: The phone number that received the message - /// Optional parameter: The status of the message. One of RECEIVED, QUEUED, SENDING, SENT, FAILED, DELIVERED, ACCEPTED, UNDELIVERED + /// Optional parameter: The status of the message. One of RECEIVED, QUEUED, SENDING, SENT, FAILED, DELIVERED, DLR_EXPIRED /// Optional parameter: The error code of the message /// Optional parameter: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. /// Optional parameter: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. @@ -450,7 +455,7 @@ public async Task DeleteMediaAsync(string accountId, string mediaId, Cancellatio /// Optional parameter: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000 /// Returns the ApiResponse response from the API call public ApiResponse GetMessages( - string accountId, + string userId, string messageId = null, string sourceTn = null, string destinationTn = null, @@ -461,7 +466,7 @@ public async Task DeleteMediaAsync(string accountId, string mediaId, Cancellatio string pageToken = null, int? limit = null) { - Task> t = GetMessagesAsync(accountId, messageId, sourceTn, destinationTn, messageStatus, errorCode, fromDateTime, toDateTime, pageToken, limit); + Task> t = GetMessagesAsync(userId, messageId, sourceTn, destinationTn, messageStatus, errorCode, fromDateTime, toDateTime, pageToken, limit); ApiHelper.RunTaskSynchronously(t); return t.Result; } @@ -469,11 +474,11 @@ public async Task DeleteMediaAsync(string accountId, string mediaId, Cancellatio /// /// getMessages /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Optional parameter: The ID of the message to search for. Special characters need to be encoded using URL encoding /// Optional parameter: The phone number that sent the message /// Optional parameter: The phone number that received the message - /// Optional parameter: The status of the message. One of RECEIVED, QUEUED, SENDING, SENT, FAILED, DELIVERED, ACCEPTED, UNDELIVERED + /// Optional parameter: The status of the message. One of RECEIVED, QUEUED, SENDING, SENT, FAILED, DELIVERED, DLR_EXPIRED /// Optional parameter: The error code of the message /// Optional parameter: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. /// Optional parameter: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. @@ -481,7 +486,7 @@ public async Task DeleteMediaAsync(string accountId, string mediaId, Cancellatio /// Optional parameter: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000 /// Returns the ApiResponse response from the API call public async Task> GetMessagesAsync( - string accountId, + string userId, string messageId = null, string sourceTn = null, string destinationTn = null, @@ -497,12 +502,12 @@ public async Task DeleteMediaAsync(string accountId, string mediaId, Cancellatio //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); - _queryBuilder.Append("/users/{accountId}/messages"); + _queryBuilder.Append("/users/{userId}/messages"); //process optional template parameters ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() { - { "accountId", accountId } + { "userId", userId } }); //prepare specfied query parameters @@ -547,32 +552,32 @@ public async Task DeleteMediaAsync(string accountId, string mediaId, Cancellatio //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new MessagingExceptionErrorException("400 Request is malformed or invalid", _context); + throw new MessagingException("400 Request is malformed or invalid", _context); } if (_response.StatusCode == 401) { - throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", _context); + throw new MessagingException("401 The specified user does not have access to the account", _context); } if (_response.StatusCode == 403) { - throw new MessagingExceptionErrorException("403 The user does not have access to this API", _context); + throw new MessagingException("403 The user does not have access to this API", _context); } if (_response.StatusCode == 404) { - throw new MessagingExceptionErrorException("404 Path not found", _context); + throw new MessagingException("404 Path not found", _context); } if (_response.StatusCode == 415) { - throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", _context); + throw new MessagingException("415 The content-type of the request is incorrect", _context); } if (_response.StatusCode == 429) { - throw new MessagingExceptionErrorException("429 The rate limit has been reached", _context); + throw new MessagingException("429 The rate limit has been reached", _context); } //handle errors defined at the API level @@ -586,12 +591,12 @@ public async Task DeleteMediaAsync(string accountId, string mediaId, Cancellatio /// /// createMessage /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Required parameter: Example: /// Returns the ApiResponse response from the API call - public ApiResponse CreateMessage(string accountId, Models.MessageRequest body) + public ApiResponse CreateMessage(string userId, Models.MessageRequest body) { - Task> t = CreateMessageAsync(accountId, body); + Task> t = CreateMessageAsync(userId, body); ApiHelper.RunTaskSynchronously(t); return t.Result; } @@ -599,22 +604,22 @@ public async Task DeleteMediaAsync(string accountId, string mediaId, Cancellatio /// /// createMessage /// - /// Required parameter: User's account ID + /// Required parameter: User's account ID /// Required parameter: Example: /// Returns the ApiResponse response from the API call - public async Task> CreateMessageAsync(string accountId, Models.MessageRequest body, CancellationToken cancellationToken = default) + public async Task> CreateMessageAsync(string userId, Models.MessageRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(Server.MessagingDefault); //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); - _queryBuilder.Append("/users/{accountId}/messages"); + _queryBuilder.Append("/users/{userId}/messages"); //process optional template parameters ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() { - { "accountId", accountId } + { "userId", userId } }); //append request with appropriate headers and parameters @@ -649,32 +654,32 @@ public async Task DeleteMediaAsync(string accountId, string mediaId, Cancellatio //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new MessagingExceptionErrorException("400 Request is malformed or invalid", _context); + throw new MessagingException("400 Request is malformed or invalid", _context); } if (_response.StatusCode == 401) { - throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", _context); + throw new MessagingException("401 The specified user does not have access to the account", _context); } if (_response.StatusCode == 403) { - throw new MessagingExceptionErrorException("403 The user does not have access to this API", _context); + throw new MessagingException("403 The user does not have access to this API", _context); } if (_response.StatusCode == 404) { - throw new MessagingExceptionErrorException("404 Path not found", _context); + throw new MessagingException("404 Path not found", _context); } if (_response.StatusCode == 415) { - throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", _context); + throw new MessagingException("415 The content-type of the request is incorrect", _context); } if (_response.StatusCode == 429) { - throw new MessagingExceptionErrorException("429 The rate limit has been reached", _context); + throw new MessagingException("429 The rate limit has been reached", _context); } //handle errors defined at the API level diff --git a/Bandwidth.Standard/Messaging/Exceptions/MessagingExceptionErrorException.cs b/Bandwidth.Standard/Messaging/Exceptions/MessagingException.cs similarity index 85% rename from Bandwidth.Standard/Messaging/Exceptions/MessagingExceptionErrorException.cs rename to Bandwidth.Standard/Messaging/Exceptions/MessagingException.cs index 526d836e..9029053f 100644 --- a/Bandwidth.Standard/Messaging/Exceptions/MessagingExceptionErrorException.cs +++ b/Bandwidth.Standard/Messaging/Exceptions/MessagingException.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -21,14 +20,14 @@ namespace Bandwidth.Standard.Messaging.Exceptions { - public class MessagingExceptionErrorException : ApiException + public class MessagingException : ApiException { /// /// Initialization constructor /// /// The reason for throwing exception /// The HTTP context that encapsulates request and response objects - public MessagingExceptionErrorException(string reason, HttpContext context) + public MessagingException(string reason, HttpContext context) : base(reason, context) { } /// diff --git a/Bandwidth.Standard/Messaging/Models/BandwidthCallbackMessage.cs b/Bandwidth.Standard/Messaging/Models/BandwidthCallbackMessage.cs index a59adc67..fef7900e 100644 --- a/Bandwidth.Standard/Messaging/Models/BandwidthCallbackMessage.cs +++ b/Bandwidth.Standard/Messaging/Models/BandwidthCallbackMessage.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -73,82 +72,5 @@ public BandwidthCallbackMessage(string time = null, [JsonProperty("message", NullValueHandling = NullValueHandling.Ignore)] public Models.BandwidthMessage Message { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"BandwidthCallbackMessage : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Time = {(Time == null ? "null" : Time == string.Empty ? "" : Time)}"); - toStringOutput.Add($"Type = {(Type == null ? "null" : Type == string.Empty ? "" : Type)}"); - toStringOutput.Add($"To = {(To == null ? "null" : To == string.Empty ? "" : To)}"); - toStringOutput.Add($"ErrorCode = {(ErrorCode == null ? "null" : ErrorCode == string.Empty ? "" : ErrorCode)}"); - toStringOutput.Add($"Description = {(Description == null ? "null" : Description == string.Empty ? "" : Description)}"); - toStringOutput.Add($"Message = {(Message == null ? "null" : Message.ToString())}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is BandwidthCallbackMessage other && - ((Time == null && other.Time == null) || (Time?.Equals(other.Time) == true)) && - ((Type == null && other.Type == null) || (Type?.Equals(other.Type) == true)) && - ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && - ((ErrorCode == null && other.ErrorCode == null) || (ErrorCode?.Equals(other.ErrorCode) == true)) && - ((Description == null && other.Description == null) || (Description?.Equals(other.Description) == true)) && - ((Message == null && other.Message == null) || (Message?.Equals(other.Message) == true)); - } - - public override int GetHashCode() - { - int hashCode = -419618432; - - if (Time != null) - { - hashCode += Time.GetHashCode(); - } - - if (Type != null) - { - hashCode += Type.GetHashCode(); - } - - if (To != null) - { - hashCode += To.GetHashCode(); - } - - if (ErrorCode != null) - { - hashCode += ErrorCode.GetHashCode(); - } - - if (Description != null) - { - hashCode += Description.GetHashCode(); - } - - if (Message != null) - { - hashCode += Message.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/BandwidthMessage.cs b/Bandwidth.Standard/Messaging/Models/BandwidthMessage.cs index 47307935..493afcf0 100644 --- a/Bandwidth.Standard/Messaging/Models/BandwidthMessage.cs +++ b/Bandwidth.Standard/Messaging/Models/BandwidthMessage.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -121,124 +120,5 @@ public BandwidthMessage(string id = null, [JsonProperty("priority", NullValueHandling = NullValueHandling.Ignore)] public string Priority { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"BandwidthMessage : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}"); - toStringOutput.Add($"Owner = {(Owner == null ? "null" : Owner == string.Empty ? "" : Owner)}"); - toStringOutput.Add($"ApplicationId = {(ApplicationId == null ? "null" : ApplicationId == string.Empty ? "" : ApplicationId)}"); - toStringOutput.Add($"Time = {(Time == null ? "null" : Time == string.Empty ? "" : Time)}"); - toStringOutput.Add($"SegmentCount = {(SegmentCount == null ? "null" : SegmentCount.ToString())}"); - toStringOutput.Add($"Direction = {(Direction == null ? "null" : Direction == string.Empty ? "" : Direction)}"); - toStringOutput.Add($"To = {(To == null ? "null" : $"[{ string.Join(", ", To)} ]")}"); - toStringOutput.Add($"From = {(From == null ? "null" : From == string.Empty ? "" : From)}"); - toStringOutput.Add($"Media = {(Media == null ? "null" : $"[{ string.Join(", ", Media)} ]")}"); - toStringOutput.Add($"Text = {(Text == null ? "null" : Text == string.Empty ? "" : Text)}"); - toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); - toStringOutput.Add($"Priority = {(Priority == null ? "null" : Priority == string.Empty ? "" : Priority)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is BandwidthMessage other && - ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) && - ((Owner == null && other.Owner == null) || (Owner?.Equals(other.Owner) == true)) && - ((ApplicationId == null && other.ApplicationId == null) || (ApplicationId?.Equals(other.ApplicationId) == true)) && - ((Time == null && other.Time == null) || (Time?.Equals(other.Time) == true)) && - ((SegmentCount == null && other.SegmentCount == null) || (SegmentCount?.Equals(other.SegmentCount) == true)) && - ((Direction == null && other.Direction == null) || (Direction?.Equals(other.Direction) == true)) && - ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && - ((From == null && other.From == null) || (From?.Equals(other.From) == true)) && - ((Media == null && other.Media == null) || (Media?.Equals(other.Media) == true)) && - ((Text == null && other.Text == null) || (Text?.Equals(other.Text) == true)) && - ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)) && - ((Priority == null && other.Priority == null) || (Priority?.Equals(other.Priority) == true)); - } - - public override int GetHashCode() - { - int hashCode = 1547980768; - - if (Id != null) - { - hashCode += Id.GetHashCode(); - } - - if (Owner != null) - { - hashCode += Owner.GetHashCode(); - } - - if (ApplicationId != null) - { - hashCode += ApplicationId.GetHashCode(); - } - - if (Time != null) - { - hashCode += Time.GetHashCode(); - } - - if (SegmentCount != null) - { - hashCode += SegmentCount.GetHashCode(); - } - - if (Direction != null) - { - hashCode += Direction.GetHashCode(); - } - - if (To != null) - { - hashCode += To.GetHashCode(); - } - - if (From != null) - { - hashCode += From.GetHashCode(); - } - - if (Media != null) - { - hashCode += Media.GetHashCode(); - } - - if (Text != null) - { - hashCode += Text.GetHashCode(); - } - - if (Tag != null) - { - hashCode += Tag.GetHashCode(); - } - - if (Priority != null) - { - hashCode += Priority.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/BandwidthMessageItem.cs b/Bandwidth.Standard/Messaging/Models/BandwidthMessageItem.cs index 441dcc35..e104022e 100644 --- a/Bandwidth.Standard/Messaging/Models/BandwidthMessageItem.cs +++ b/Bandwidth.Standard/Messaging/Models/BandwidthMessageItem.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -113,117 +112,5 @@ public BandwidthMessageItem(string messageId = null, [JsonProperty("carrierName", NullValueHandling = NullValueHandling.Ignore)] public string CarrierName { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"BandwidthMessageItem : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"MessageId = {(MessageId == null ? "null" : MessageId == string.Empty ? "" : MessageId)}"); - toStringOutput.Add($"AccountId = {(AccountId == null ? "null" : AccountId == string.Empty ? "" : AccountId)}"); - toStringOutput.Add($"SourceTn = {(SourceTn == null ? "null" : SourceTn == string.Empty ? "" : SourceTn)}"); - toStringOutput.Add($"DestinationTn = {(DestinationTn == null ? "null" : DestinationTn == string.Empty ? "" : DestinationTn)}"); - toStringOutput.Add($"MessageStatus = {(MessageStatus == null ? "null" : MessageStatus == string.Empty ? "" : MessageStatus)}"); - toStringOutput.Add($"MessageDirection = {(MessageDirection == null ? "null" : MessageDirection == string.Empty ? "" : MessageDirection)}"); - toStringOutput.Add($"MessageType = {(MessageType == null ? "null" : MessageType == string.Empty ? "" : MessageType)}"); - toStringOutput.Add($"SegmentCount = {(SegmentCount == null ? "null" : SegmentCount.ToString())}"); - toStringOutput.Add($"ErrorCode = {(ErrorCode == null ? "null" : ErrorCode.ToString())}"); - toStringOutput.Add($"ReceiveTime = {(ReceiveTime == null ? "null" : ReceiveTime == string.Empty ? "" : ReceiveTime)}"); - toStringOutput.Add($"CarrierName = {(CarrierName == null ? "null" : CarrierName == string.Empty ? "" : CarrierName)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is BandwidthMessageItem other && - ((MessageId == null && other.MessageId == null) || (MessageId?.Equals(other.MessageId) == true)) && - ((AccountId == null && other.AccountId == null) || (AccountId?.Equals(other.AccountId) == true)) && - ((SourceTn == null && other.SourceTn == null) || (SourceTn?.Equals(other.SourceTn) == true)) && - ((DestinationTn == null && other.DestinationTn == null) || (DestinationTn?.Equals(other.DestinationTn) == true)) && - ((MessageStatus == null && other.MessageStatus == null) || (MessageStatus?.Equals(other.MessageStatus) == true)) && - ((MessageDirection == null && other.MessageDirection == null) || (MessageDirection?.Equals(other.MessageDirection) == true)) && - ((MessageType == null && other.MessageType == null) || (MessageType?.Equals(other.MessageType) == true)) && - ((SegmentCount == null && other.SegmentCount == null) || (SegmentCount?.Equals(other.SegmentCount) == true)) && - ((ErrorCode == null && other.ErrorCode == null) || (ErrorCode?.Equals(other.ErrorCode) == true)) && - ((ReceiveTime == null && other.ReceiveTime == null) || (ReceiveTime?.Equals(other.ReceiveTime) == true)) && - ((CarrierName == null && other.CarrierName == null) || (CarrierName?.Equals(other.CarrierName) == true)); - } - - public override int GetHashCode() - { - int hashCode = 498628859; - - if (MessageId != null) - { - hashCode += MessageId.GetHashCode(); - } - - if (AccountId != null) - { - hashCode += AccountId.GetHashCode(); - } - - if (SourceTn != null) - { - hashCode += SourceTn.GetHashCode(); - } - - if (DestinationTn != null) - { - hashCode += DestinationTn.GetHashCode(); - } - - if (MessageStatus != null) - { - hashCode += MessageStatus.GetHashCode(); - } - - if (MessageDirection != null) - { - hashCode += MessageDirection.GetHashCode(); - } - - if (MessageType != null) - { - hashCode += MessageType.GetHashCode(); - } - - if (SegmentCount != null) - { - hashCode += SegmentCount.GetHashCode(); - } - - if (ErrorCode != null) - { - hashCode += ErrorCode.GetHashCode(); - } - - if (ReceiveTime != null) - { - hashCode += ReceiveTime.GetHashCode(); - } - - if (CarrierName != null) - { - hashCode += CarrierName.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/BandwidthMessagesList.cs b/Bandwidth.Standard/Messaging/Models/BandwidthMessagesList.cs index 2a3a70d2..21a9ac4f 100644 --- a/Bandwidth.Standard/Messaging/Models/BandwidthMessagesList.cs +++ b/Bandwidth.Standard/Messaging/Models/BandwidthMessagesList.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -49,61 +48,5 @@ public BandwidthMessagesList(int? totalCount = null, [JsonProperty("messages", NullValueHandling = NullValueHandling.Ignore)] public List Messages { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"BandwidthMessagesList : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"TotalCount = {(TotalCount == null ? "null" : TotalCount.ToString())}"); - toStringOutput.Add($"PageInfo = {(PageInfo == null ? "null" : PageInfo.ToString())}"); - toStringOutput.Add($"Messages = {(Messages == null ? "null" : $"[{ string.Join(", ", Messages)} ]")}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is BandwidthMessagesList other && - ((TotalCount == null && other.TotalCount == null) || (TotalCount?.Equals(other.TotalCount) == true)) && - ((PageInfo == null && other.PageInfo == null) || (PageInfo?.Equals(other.PageInfo) == true)) && - ((Messages == null && other.Messages == null) || (Messages?.Equals(other.Messages) == true)); - } - - public override int GetHashCode() - { - int hashCode = 23261715; - - if (TotalCount != null) - { - hashCode += TotalCount.GetHashCode(); - } - - if (PageInfo != null) - { - hashCode += PageInfo.GetHashCode(); - } - - if (Messages != null) - { - hashCode += Messages.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/DeferredResult.cs b/Bandwidth.Standard/Messaging/Models/DeferredResult.cs index df801919..4c1eaaf9 100644 --- a/Bandwidth.Standard/Messaging/Models/DeferredResult.cs +++ b/Bandwidth.Standard/Messaging/Models/DeferredResult.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -41,54 +40,5 @@ public DeferredResult(object result = null, [JsonProperty("setOrExpired", NullValueHandling = NullValueHandling.Ignore)] public bool? SetOrExpired { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"DeferredResult : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Result = {(Result == null ? "null" : Result.ToString())}"); - toStringOutput.Add($"SetOrExpired = {(SetOrExpired == null ? "null" : SetOrExpired.ToString())}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is DeferredResult other && - ((Result == null && other.Result == null) || (Result?.Equals(other.Result) == true)) && - ((SetOrExpired == null && other.SetOrExpired == null) || (SetOrExpired?.Equals(other.SetOrExpired) == true)); - } - - public override int GetHashCode() - { - int hashCode = -1571367651; - - if (Result != null) - { - hashCode += Result.GetHashCode(); - } - - if (SetOrExpired != null) - { - hashCode += SetOrExpired.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/Media.cs b/Bandwidth.Standard/Messaging/Models/Media.cs index a278f0ae..13cd55b9 100644 --- a/Bandwidth.Standard/Messaging/Models/Media.cs +++ b/Bandwidth.Standard/Messaging/Models/Media.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -22,88 +21,88 @@ public class Media { public Media() { } - public Media(string content = null, - int? contentLength = null, - string mediaName = null) + public Media(object inputStream = null, + string content = null, + string url = null, + string contentLength = null, + string contentType = null, + List tags = null, + string userId = null, + string mediaName = null, + string mediaId = null, + string cacheControl = null) { + InputStream = inputStream; Content = content; + Url = url; ContentLength = contentLength; + ContentType = contentType; + Tags = tags; + UserId = userId; MediaName = mediaName; + MediaId = mediaId; + CacheControl = cacheControl; } + /// + /// Getter for inputStream + /// + [JsonProperty("inputStream", NullValueHandling = NullValueHandling.Ignore)] + public object InputStream { get; set; } + /// /// Getter for content /// [JsonProperty("content", NullValueHandling = NullValueHandling.Ignore)] public string Content { get; set; } + /// + /// Getter for url + /// + [JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)] + public string Url { get; set; } + /// /// Getter for contentLength /// [JsonProperty("contentLength", NullValueHandling = NullValueHandling.Ignore)] - public int? ContentLength { get; set; } + public string ContentLength { get; set; } /// - /// Getter for mediaName + /// Getter for contentType /// - [JsonProperty("mediaName", NullValueHandling = NullValueHandling.Ignore)] - public string MediaName { get; set; } - - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"Media : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Content = {(Content == null ? "null" : Content == string.Empty ? "" : Content)}"); - toStringOutput.Add($"ContentLength = {(ContentLength == null ? "null" : ContentLength.ToString())}"); - toStringOutput.Add($"MediaName = {(MediaName == null ? "null" : MediaName == string.Empty ? "" : MediaName)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } + [JsonProperty("contentType", NullValueHandling = NullValueHandling.Ignore)] + public string ContentType { get; set; } - return obj is Media other && - ((Content == null && other.Content == null) || (Content?.Equals(other.Content) == true)) && - ((ContentLength == null && other.ContentLength == null) || (ContentLength?.Equals(other.ContentLength) == true)) && - ((MediaName == null && other.MediaName == null) || (MediaName?.Equals(other.MediaName) == true)); - } - - public override int GetHashCode() - { - int hashCode = 457305241; + /// + /// Getter for tags + /// + [JsonProperty("tags", NullValueHandling = NullValueHandling.Ignore)] + public List Tags { get; set; } - if (Content != null) - { - hashCode += Content.GetHashCode(); - } + /// + /// User's account ID + /// + [JsonProperty("userId", NullValueHandling = NullValueHandling.Ignore)] + public string UserId { get; set; } - if (ContentLength != null) - { - hashCode += ContentLength.GetHashCode(); - } + /// + /// Getter for mediaName + /// + [JsonProperty("mediaName", NullValueHandling = NullValueHandling.Ignore)] + public string MediaName { get; set; } - if (MediaName != null) - { - hashCode += MediaName.GetHashCode(); - } + /// + /// Getter for mediaId + /// + [JsonProperty("mediaId", NullValueHandling = NullValueHandling.Ignore)] + public string MediaId { get; set; } - return hashCode; - } + /// + /// Getter for cacheControl + /// + [JsonProperty("cacheControl", NullValueHandling = NullValueHandling.Ignore)] + public string CacheControl { get; set; } } } \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/MessageRequest.cs b/Bandwidth.Standard/Messaging/Models/MessageRequest.cs index 6afada4d..2b41cc05 100644 --- a/Bandwidth.Standard/Messaging/Models/MessageRequest.cs +++ b/Bandwidth.Standard/Messaging/Models/MessageRequest.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -81,89 +80,5 @@ public MessageRequest(string applicationId, [JsonProperty("priority", ItemConverterType = typeof(StringValuedEnumConverter), NullValueHandling = NullValueHandling.Ignore)] public Models.PriorityEnum? Priority { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"MessageRequest : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"ApplicationId = {(ApplicationId == null ? "null" : ApplicationId == string.Empty ? "" : ApplicationId)}"); - toStringOutput.Add($"To = {(To == null ? "null" : $"[{ string.Join(", ", To)} ]")}"); - toStringOutput.Add($"From = {(From == null ? "null" : From == string.Empty ? "" : From)}"); - toStringOutput.Add($"Text = {(Text == null ? "null" : Text == string.Empty ? "" : Text)}"); - toStringOutput.Add($"Media = {(Media == null ? "null" : $"[{ string.Join(", ", Media)} ]")}"); - toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); - toStringOutput.Add($"Priority = {(Priority == null ? "null" : Priority.ToString())}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is MessageRequest other && - ((ApplicationId == null && other.ApplicationId == null) || (ApplicationId?.Equals(other.ApplicationId) == true)) && - ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && - ((From == null && other.From == null) || (From?.Equals(other.From) == true)) && - ((Text == null && other.Text == null) || (Text?.Equals(other.Text) == true)) && - ((Media == null && other.Media == null) || (Media?.Equals(other.Media) == true)) && - ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)) && - ((Priority == null && other.Priority == null) || (Priority?.Equals(other.Priority) == true)); - } - - public override int GetHashCode() - { - int hashCode = -287486185; - - if (ApplicationId != null) - { - hashCode += ApplicationId.GetHashCode(); - } - - if (To != null) - { - hashCode += To.GetHashCode(); - } - - if (From != null) - { - hashCode += From.GetHashCode(); - } - - if (Text != null) - { - hashCode += Text.GetHashCode(); - } - - if (Media != null) - { - hashCode += Media.GetHashCode(); - } - - if (Tag != null) - { - hashCode += Tag.GetHashCode(); - } - - if (Priority != null) - { - hashCode += Priority.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/MessagingException.cs b/Bandwidth.Standard/Messaging/Models/MessagingException.cs deleted file mode 100644 index 61f8ce51..00000000 --- a/Bandwidth.Standard/Messaging/Models/MessagingException.cs +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.Messaging.Models -{ - public class MessagingException - { - public MessagingException() { } - - public MessagingException(string type, - string description) - { - Type = type; - Description = description; - } - - /// - /// Getter for type - /// - [JsonProperty("type")] - public string Type { get; set; } - - /// - /// Getter for description - /// - [JsonProperty("description")] - public string Description { get; set; } - - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"MessagingException : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Type = {(Type == null ? "null" : Type == string.Empty ? "" : Type)}"); - toStringOutput.Add($"Description = {(Description == null ? "null" : Description == string.Empty ? "" : Description)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is MessagingException other && - ((Type == null && other.Type == null) || (Type?.Equals(other.Type) == true)) && - ((Description == null && other.Description == null) || (Description?.Equals(other.Description) == true)); - } - - public override int GetHashCode() - { - int hashCode = -855072673; - - if (Type != null) - { - hashCode += Type.GetHashCode(); - } - - if (Description != null) - { - hashCode += Description.GetHashCode(); - } - - return hashCode; - } - - } -} \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/PageInfo.cs b/Bandwidth.Standard/Messaging/Models/PageInfo.cs index f0a33281..febffc5d 100644 --- a/Bandwidth.Standard/Messaging/Models/PageInfo.cs +++ b/Bandwidth.Standard/Messaging/Models/PageInfo.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -57,68 +56,5 @@ public PageInfo(string prevPage = null, [JsonProperty("nextPageToken", NullValueHandling = NullValueHandling.Ignore)] public string NextPageToken { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"PageInfo : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"PrevPage = {(PrevPage == null ? "null" : PrevPage == string.Empty ? "" : PrevPage)}"); - toStringOutput.Add($"NextPage = {(NextPage == null ? "null" : NextPage == string.Empty ? "" : NextPage)}"); - toStringOutput.Add($"PrevPageToken = {(PrevPageToken == null ? "null" : PrevPageToken == string.Empty ? "" : PrevPageToken)}"); - toStringOutput.Add($"NextPageToken = {(NextPageToken == null ? "null" : NextPageToken == string.Empty ? "" : NextPageToken)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is PageInfo other && - ((PrevPage == null && other.PrevPage == null) || (PrevPage?.Equals(other.PrevPage) == true)) && - ((NextPage == null && other.NextPage == null) || (NextPage?.Equals(other.NextPage) == true)) && - ((PrevPageToken == null && other.PrevPageToken == null) || (PrevPageToken?.Equals(other.PrevPageToken) == true)) && - ((NextPageToken == null && other.NextPageToken == null) || (NextPageToken?.Equals(other.NextPageToken) == true)); - } - - public override int GetHashCode() - { - int hashCode = -1830408517; - - if (PrevPage != null) - { - hashCode += PrevPage.GetHashCode(); - } - - if (NextPage != null) - { - hashCode += NextPage.GetHashCode(); - } - - if (PrevPageToken != null) - { - hashCode += PrevPageToken.GetHashCode(); - } - - if (NextPageToken != null) - { - hashCode += NextPageToken.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Messaging/Models/Tag.cs b/Bandwidth.Standard/Messaging/Models/Tag.cs index 9e0bd20b..00f07dbd 100644 --- a/Bandwidth.Standard/Messaging/Models/Tag.cs +++ b/Bandwidth.Standard/Messaging/Models/Tag.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -41,54 +40,5 @@ public Tag(string key = null, [JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)] public string MValue { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"Tag : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Key = {(Key == null ? "null" : Key == string.Empty ? "" : Key)}"); - toStringOutput.Add($"MValue = {(MValue == null ? "null" : MValue == string.Empty ? "" : MValue)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is Tag other && - ((Key == null && other.Key == null) || (Key?.Equals(other.Key) == true)) && - ((MValue == null && other.MValue == null) || (MValue?.Equals(other.MValue) == true)); - } - - public override int GetHashCode() - { - int hashCode = -458578094; - - if (Key != null) - { - hashCode += Key.GetHashCode(); - } - - if (MValue != null) - { - hashCode += MValue.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/MultiFactorAuth/Models/ErrorWithRequest.cs b/Bandwidth.Standard/MultiFactorAuth/Models/ErrorWithRequest.cs deleted file mode 100644 index 72c57755..00000000 --- a/Bandwidth.Standard/MultiFactorAuth/Models/ErrorWithRequest.cs +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.MultiFactorAuth.Models -{ - public class ErrorWithRequest - { - public ErrorWithRequest() { } - - public ErrorWithRequest(string error = null, - string requestId = null) - { - Error = error; - RequestId = requestId; - } - - /// - /// An error message pertaining to what the issue could be - /// - [JsonProperty("error", NullValueHandling = NullValueHandling.Ignore)] - public string Error { get; set; } - - /// - /// The associated requestId from AWS - /// - [JsonProperty("requestId", NullValueHandling = NullValueHandling.Ignore)] - public string RequestId { get; set; } - - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"ErrorWithRequest : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Error = {(Error == null ? "null" : Error == string.Empty ? "" : Error)}"); - toStringOutput.Add($"RequestId = {(RequestId == null ? "null" : RequestId == string.Empty ? "" : RequestId)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is ErrorWithRequest other && - ((Error == null && other.Error == null) || (Error?.Equals(other.Error) == true)) && - ((RequestId == null && other.RequestId == null) || (RequestId?.Equals(other.RequestId) == true)); - } - - public override int GetHashCode() - { - int hashCode = -1751201851; - - if (Error != null) - { - hashCode += Error.GetHashCode(); - } - - if (RequestId != null) - { - hashCode += RequestId.GetHashCode(); - } - - return hashCode; - } - - } -} \ No newline at end of file diff --git a/Bandwidth.Standard/MultiFactorAuth/Models/ForbiddenRequest.cs b/Bandwidth.Standard/MultiFactorAuth/Models/ForbiddenRequest.cs deleted file mode 100644 index fff7124e..00000000 --- a/Bandwidth.Standard/MultiFactorAuth/Models/ForbiddenRequest.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.MultiFactorAuth.Models -{ - public class ForbiddenRequest - { - public ForbiddenRequest() { } - - public ForbiddenRequest(string message = null) - { - Message = message; - } - - /// - /// The message containing the reason behind the request being forbidden - /// - [JsonProperty("Message", NullValueHandling = NullValueHandling.Ignore)] - public string Message { get; set; } - - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"ForbiddenRequest : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Message = {(Message == null ? "null" : Message == string.Empty ? "" : Message)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is ForbiddenRequest other && - ((Message == null && other.Message == null) || (Message?.Equals(other.Message) == true)); - } - - public override int GetHashCode() - { - int hashCode = -1832523942; - - if (Message != null) - { - hashCode += Message.GetHashCode(); - } - - return hashCode; - } - - } -} \ No newline at end of file diff --git a/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorCodeRequestSchema.cs b/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorCodeRequestSchema.cs deleted file mode 100644 index 444acba7..00000000 --- a/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorCodeRequestSchema.cs +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.MultiFactorAuth.Models -{ - public class TwoFactorCodeRequestSchema - { - public TwoFactorCodeRequestSchema() { } - - public TwoFactorCodeRequestSchema(string to, - string from, - string applicationId, - string message, - double digits, - string scope = null) - { - To = to; - From = from; - ApplicationId = applicationId; - Scope = scope; - Message = message; - Digits = digits; - } - - /// - /// The phone number to send the 2fa code to. - /// - [JsonProperty("to")] - public string To { get; set; } - - /// - /// The application phone number, the sender of the 2fa code. - /// - [JsonProperty("from")] - public string From { get; set; } - - /// - /// The application unique ID, obtained from Bandwidth. - /// - [JsonProperty("applicationId")] - public string ApplicationId { get; set; } - - /// - /// An optional field to denote what scope or action the 2fa code is addressing. If not supplied, defaults to "2FA". - /// - [JsonProperty("scope", NullValueHandling = NullValueHandling.Ignore)] - public string Scope { get; set; } - - /// - /// The message format of the 2fa code. There are three values that the system will replace "{CODE}", "{NAME}", "{SCOPE}". The "{SCOPE}" and "{NAME} value template are optional, while "{CODE}" must be supplied. As the name would suggest, code will be replace with the actual 2fa code. Name is replaced with the application name, configured during provisioning of 2fa. The scope value is the same value sent during the call and partitioned by the server. - /// - [JsonProperty("message")] - public string Message { get; set; } - - /// - /// The number of digits for your 2fa code. The valid number ranges from 2 to 8, inclusively. - /// - [JsonProperty("digits")] - public double Digits { get; set; } - - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"TwoFactorCodeRequestSchema : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"To = {(To == null ? "null" : To == string.Empty ? "" : To)}"); - toStringOutput.Add($"From = {(From == null ? "null" : From == string.Empty ? "" : From)}"); - toStringOutput.Add($"ApplicationId = {(ApplicationId == null ? "null" : ApplicationId == string.Empty ? "" : ApplicationId)}"); - toStringOutput.Add($"Scope = {(Scope == null ? "null" : Scope == string.Empty ? "" : Scope)}"); - toStringOutput.Add($"Message = {(Message == null ? "null" : Message == string.Empty ? "" : Message)}"); - toStringOutput.Add($"Digits = {Digits}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is TwoFactorCodeRequestSchema other && - ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && - ((From == null && other.From == null) || (From?.Equals(other.From) == true)) && - ((ApplicationId == null && other.ApplicationId == null) || (ApplicationId?.Equals(other.ApplicationId) == true)) && - ((Scope == null && other.Scope == null) || (Scope?.Equals(other.Scope) == true)) && - ((Message == null && other.Message == null) || (Message?.Equals(other.Message) == true)) && - Digits.Equals(other.Digits); - } - - public override int GetHashCode() - { - int hashCode = -1960364933; - - if (To != null) - { - hashCode += To.GetHashCode(); - } - - if (From != null) - { - hashCode += From.GetHashCode(); - } - - if (ApplicationId != null) - { - hashCode += ApplicationId.GetHashCode(); - } - - if (Scope != null) - { - hashCode += Scope.GetHashCode(); - } - - if (Message != null) - { - hashCode += Message.GetHashCode(); - } - hashCode += Digits.GetHashCode(); - - return hashCode; - } - - } -} \ No newline at end of file diff --git a/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorMessagingResponse.cs b/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorMessagingResponse.cs deleted file mode 100644 index 967a56c2..00000000 --- a/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorMessagingResponse.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.MultiFactorAuth.Models -{ - public class TwoFactorMessagingResponse - { - public TwoFactorMessagingResponse() { } - - public TwoFactorMessagingResponse(string messageId = null) - { - MessageId = messageId; - } - - /// - /// Getter for messageId - /// - [JsonProperty("messageId", NullValueHandling = NullValueHandling.Ignore)] - public string MessageId { get; set; } - - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"TwoFactorMessagingResponse : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"MessageId = {(MessageId == null ? "null" : MessageId == string.Empty ? "" : MessageId)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is TwoFactorMessagingResponse other && - ((MessageId == null && other.MessageId == null) || (MessageId?.Equals(other.MessageId) == true)); - } - - public override int GetHashCode() - { - int hashCode = 1575158831; - - if (MessageId != null) - { - hashCode += MessageId.GetHashCode(); - } - - return hashCode; - } - - } -} \ No newline at end of file diff --git a/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVerifyCodeResponse.cs b/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVerifyCodeResponse.cs deleted file mode 100644 index 558a1fe1..00000000 --- a/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVerifyCodeResponse.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.MultiFactorAuth.Models -{ - public class TwoFactorVerifyCodeResponse - { - public TwoFactorVerifyCodeResponse() { } - - public TwoFactorVerifyCodeResponse(bool? valid = null) - { - Valid = valid; - } - - /// - /// Getter for valid - /// - [JsonProperty("valid", NullValueHandling = NullValueHandling.Ignore)] - public bool? Valid { get; set; } - - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"TwoFactorVerifyCodeResponse : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Valid = {(Valid == null ? "null" : Valid.ToString())}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is TwoFactorVerifyCodeResponse other && - ((Valid == null && other.Valid == null) || (Valid?.Equals(other.Valid) == true)); - } - - public override int GetHashCode() - { - int hashCode = 1979617985; - - if (Valid != null) - { - hashCode += Valid.GetHashCode(); - } - - return hashCode; - } - - } -} \ No newline at end of file diff --git a/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVerifyRequestSchema.cs b/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVerifyRequestSchema.cs deleted file mode 100644 index 90b5c307..00000000 --- a/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVerifyRequestSchema.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.MultiFactorAuth.Models -{ - public class TwoFactorVerifyRequestSchema - { - public TwoFactorVerifyRequestSchema() { } - - public TwoFactorVerifyRequestSchema(string to, - string applicationId, - double expirationTimeInMinutes, - string code, - string scope = null) - { - To = to; - ApplicationId = applicationId; - Scope = scope; - ExpirationTimeInMinutes = expirationTimeInMinutes; - Code = code; - } - - /// - /// The phone number to send the 2fa code to. - /// - [JsonProperty("to")] - public string To { get; set; } - - /// - /// The application unique ID, obtained from Bandwidth. - /// - [JsonProperty("applicationId")] - public string ApplicationId { get; set; } - - /// - /// An optional field to denote what scope or action the 2fa code is addressing. If not supplied, defaults to "2FA". - /// - [JsonProperty("scope", NullValueHandling = NullValueHandling.Ignore)] - public string Scope { get; set; } - - /// - /// The time period, in minutes, to validate the 2fa code. By setting this to 3 minutes, it will mean any code generated within the last 3 minutes are still valid. The valid range for expiration time is between 0 and 15 minutes, exclusively and inclusively, respectively. - /// - [JsonProperty("expirationTimeInMinutes")] - public double ExpirationTimeInMinutes { get; set; } - - /// - /// The generated 2fa code to check if valid - /// - [JsonProperty("code")] - public string Code { get; set; } - - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"TwoFactorVerifyRequestSchema : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"To = {(To == null ? "null" : To == string.Empty ? "" : To)}"); - toStringOutput.Add($"ApplicationId = {(ApplicationId == null ? "null" : ApplicationId == string.Empty ? "" : ApplicationId)}"); - toStringOutput.Add($"Scope = {(Scope == null ? "null" : Scope == string.Empty ? "" : Scope)}"); - toStringOutput.Add($"ExpirationTimeInMinutes = {ExpirationTimeInMinutes}"); - toStringOutput.Add($"Code = {(Code == null ? "null" : Code == string.Empty ? "" : Code)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is TwoFactorVerifyRequestSchema other && - ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && - ((ApplicationId == null && other.ApplicationId == null) || (ApplicationId?.Equals(other.ApplicationId) == true)) && - ((Scope == null && other.Scope == null) || (Scope?.Equals(other.Scope) == true)) && - ExpirationTimeInMinutes.Equals(other.ExpirationTimeInMinutes) && - ((Code == null && other.Code == null) || (Code?.Equals(other.Code) == true)); - } - - public override int GetHashCode() - { - int hashCode = -2106512680; - - if (To != null) - { - hashCode += To.GetHashCode(); - } - - if (ApplicationId != null) - { - hashCode += ApplicationId.GetHashCode(); - } - - if (Scope != null) - { - hashCode += Scope.GetHashCode(); - } - hashCode += ExpirationTimeInMinutes.GetHashCode(); - - if (Code != null) - { - hashCode += Code.GetHashCode(); - } - - return hashCode; - } - - } -} \ No newline at end of file diff --git a/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVoiceResponse.cs b/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVoiceResponse.cs deleted file mode 100644 index cba56aa5..00000000 --- a/Bandwidth.Standard/MultiFactorAuth/Models/TwoFactorVoiceResponse.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.MultiFactorAuth.Models -{ - public class TwoFactorVoiceResponse - { - public TwoFactorVoiceResponse() { } - - public TwoFactorVoiceResponse(string callId = null) - { - CallId = callId; - } - - /// - /// Getter for callId - /// - [JsonProperty("callId", NullValueHandling = NullValueHandling.Ignore)] - public string CallId { get; set; } - - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"TwoFactorVoiceResponse : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"CallId = {(CallId == null ? "null" : CallId == string.Empty ? "" : CallId)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is TwoFactorVoiceResponse other && - ((CallId == null && other.CallId == null) || (CallId?.Equals(other.CallId) == true)); - } - - public override int GetHashCode() - { - int hashCode = 1475004682; - - if (CallId != null) - { - hashCode += CallId.GetHashCode(); - } - - return hashCode; - } - - } -} \ No newline at end of file diff --git a/Bandwidth.Standard/MultiFactorAuth/Models/UnauthorizedRequest.cs b/Bandwidth.Standard/MultiFactorAuth/Models/UnauthorizedRequest.cs deleted file mode 100644 index f1643a8d..00000000 --- a/Bandwidth.Standard/MultiFactorAuth/Models/UnauthorizedRequest.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.MultiFactorAuth.Models -{ - public class UnauthorizedRequest - { - public UnauthorizedRequest() { } - - public UnauthorizedRequest(string message = null) - { - Message = message; - } - - /// - /// The message containing the reason behind the request being unauthorized - /// - [JsonProperty("message", NullValueHandling = NullValueHandling.Ignore)] - public string Message { get; set; } - - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"UnauthorizedRequest : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Message = {(Message == null ? "null" : Message == string.Empty ? "" : Message)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is UnauthorizedRequest other && - ((Message == null && other.Message == null) || (Message?.Equals(other.Message) == true)); - } - - public override int GetHashCode() - { - int hashCode = 448320439; - - if (Message != null) - { - hashCode += Message.GetHashCode(); - } - - return hashCode; - } - - } -} \ No newline at end of file diff --git a/Bandwidth.Standard/Server.cs b/Bandwidth.Standard/Server.cs index 97212abe..d24875bc 100644 --- a/Bandwidth.Standard/Server.cs +++ b/Bandwidth.Standard/Server.cs @@ -8,7 +8,7 @@ public enum Server { Default, MessagingDefault, - MultiFactorAuthDefault, + TwoFactorAuthDefault, VoiceDefault, WebRtcDefault, } diff --git a/Bandwidth.Standard/MultiFactorAuth/Controllers/MFAController.cs b/Bandwidth.Standard/TwoFactorAuth/Controllers/MFAController.cs similarity index 82% rename from Bandwidth.Standard/MultiFactorAuth/Controllers/MFAController.cs rename to Bandwidth.Standard/TwoFactorAuth/Controllers/MFAController.cs index 00a54c87..1ba8b026 100644 --- a/Bandwidth.Standard/MultiFactorAuth/Controllers/MFAController.cs +++ b/Bandwidth.Standard/TwoFactorAuth/Controllers/MFAController.cs @@ -19,9 +19,9 @@ using Bandwidth.Standard.Http.Response; using Bandwidth.Standard.Http.Client; using Bandwidth.Standard.Authentication; -using Bandwidth.Standard.MultiFactorAuth.Exceptions; +using Bandwidth.Standard.TwoFactorAuth.Exceptions; -namespace Bandwidth.Standard.MultiFactorAuth.Controllers +namespace Bandwidth.Standard.TwoFactorAuth.Controllers { public class MFAController : BaseController { @@ -51,7 +51,7 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar public async Task> CreateVoiceTwoFactorAsync(string accountId, Models.TwoFactorCodeRequestSchema body, CancellationToken cancellationToken = default) { //the base uri for api requests - string _baseUri = config.GetBaseUri(Server.MultiFactorAuthDefault); + string _baseUri = config.GetBaseUri(Server.TwoFactorAuthDefault); //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); @@ -81,7 +81,7 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = await authManagers["multiFactorAuth"].ApplyAsync(_request).ConfigureAwait(false); + _request = await authManagers["twoFactorAuth"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); @@ -95,22 +95,22 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ErrorWithRequestErrorException("If there is any issue with values passed in by the user", _context); + throw new ErrorWithRequestException("If there is any issue with values passed in by the user", _context); } if (_response.StatusCode == 401) { - throw new UnauthorizedRequestErrorException("Authentication is either incorrect or not present", _context); + throw new UnauthorizedRequestException("Authentication is either incorrect or not present", _context); } if (_response.StatusCode == 403) { - throw new ForbiddenRequestErrorException("The user is not authorized to access this resource", _context); + throw new ForbiddenRequestException("The user is not authorized to access this resource", _context); } if (_response.StatusCode == 500) { - throw new ErrorWithRequestErrorException("An internal server error occurred", _context); + throw new ErrorWithRequestException("An internal server error occurred", _context); } //handle errors defined at the API level @@ -143,7 +143,7 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar public async Task> CreateMessagingTwoFactorAsync(string accountId, Models.TwoFactorCodeRequestSchema body, CancellationToken cancellationToken = default) { //the base uri for api requests - string _baseUri = config.GetBaseUri(Server.MultiFactorAuthDefault); + string _baseUri = config.GetBaseUri(Server.TwoFactorAuthDefault); //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); @@ -173,7 +173,7 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = await authManagers["multiFactorAuth"].ApplyAsync(_request).ConfigureAwait(false); + _request = await authManagers["twoFactorAuth"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); @@ -187,22 +187,22 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ErrorWithRequestErrorException("If there is any issue with values passed in by the user", _context); + throw new ErrorWithRequestException("If there is any issue with values passed in by the user", _context); } if (_response.StatusCode == 401) { - throw new UnauthorizedRequestErrorException("Authentication is either incorrect or not present", _context); + throw new UnauthorizedRequestException("Authentication is either incorrect or not present", _context); } if (_response.StatusCode == 403) { - throw new ForbiddenRequestErrorException("The user is not authorized to access this resource", _context); + throw new ForbiddenRequestException("The user is not authorized to access this resource", _context); } if (_response.StatusCode == 500) { - throw new ErrorWithRequestErrorException("An internal server error occurred", _context); + throw new ErrorWithRequestException("An internal server error occurred", _context); } //handle errors defined at the API level @@ -235,7 +235,7 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar public async Task> CreateVerifyTwoFactorAsync(string accountId, Models.TwoFactorVerifyRequestSchema body, CancellationToken cancellationToken = default) { //the base uri for api requests - string _baseUri = config.GetBaseUri(Server.MultiFactorAuthDefault); + string _baseUri = config.GetBaseUri(Server.TwoFactorAuthDefault); //prepare query string for API call StringBuilder _queryBuilder = new StringBuilder(_baseUri); @@ -265,7 +265,7 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = await authManagers["multiFactorAuth"].ApplyAsync(_request).ConfigureAwait(false); + _request = await authManagers["twoFactorAuth"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); @@ -279,27 +279,27 @@ internal MFAController(IConfiguration config, IHttpClient httpClient, IDictionar //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ErrorWithRequestErrorException("If there is any issue with values passed in by the user", _context); + throw new ErrorWithRequestException("If there is any issue with values passed in by the user", _context); } if (_response.StatusCode == 401) { - throw new UnauthorizedRequestErrorException("Authentication is either incorrect or not present", _context); + throw new UnauthorizedRequestException("Authentication is either incorrect or not present", _context); } if (_response.StatusCode == 403) { - throw new ForbiddenRequestErrorException("The user is not authorized to access this resource", _context); + throw new ForbiddenRequestException("The user is not authorized to access this resource", _context); } if (_response.StatusCode == 429) { - throw new ErrorWithRequestErrorException("The user has made too many bad requests and is temporarily locked out", _context); + throw new ErrorWithRequestException("The user has made too many bad requests and is temporarily locked out", _context); } if (_response.StatusCode == 500) { - throw new ErrorWithRequestErrorException("An internal server error occurred", _context); + throw new ErrorWithRequestException("An internal server error occurred", _context); } //handle errors defined at the API level diff --git a/Bandwidth.Standard/MultiFactorAuth/Exceptions/ErrorWithRequestErrorException.cs b/Bandwidth.Standard/TwoFactorAuth/Exceptions/ErrorWithRequestException.cs similarity index 80% rename from Bandwidth.Standard/MultiFactorAuth/Exceptions/ErrorWithRequestErrorException.cs rename to Bandwidth.Standard/TwoFactorAuth/Exceptions/ErrorWithRequestException.cs index 36a59358..ce262735 100644 --- a/Bandwidth.Standard/MultiFactorAuth/Exceptions/ErrorWithRequestErrorException.cs +++ b/Bandwidth.Standard/TwoFactorAuth/Exceptions/ErrorWithRequestException.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -15,20 +14,20 @@ using Newtonsoft.Json.Converters; using Bandwidth.Standard.Http.Client; using Bandwidth.Standard.Exceptions; -using Bandwidth.Standard.MultiFactorAuth.Models; +using Bandwidth.Standard.TwoFactorAuth.Models; using Bandwidth.Standard; using Bandwidth.Standard.Utilities; -namespace Bandwidth.Standard.MultiFactorAuth.Exceptions +namespace Bandwidth.Standard.TwoFactorAuth.Exceptions { - public class ErrorWithRequestErrorException : ApiException + public class ErrorWithRequestException : ApiException { /// /// Initialization constructor /// /// The reason for throwing exception /// The HTTP context that encapsulates request and response objects - public ErrorWithRequestErrorException(string reason, HttpContext context) + public ErrorWithRequestException(string reason, HttpContext context) : base(reason, context) { } /// diff --git a/Bandwidth.Standard/MultiFactorAuth/Exceptions/ForbiddenRequestErrorException.cs b/Bandwidth.Standard/TwoFactorAuth/Exceptions/ForbiddenRequestException.cs similarity index 78% rename from Bandwidth.Standard/MultiFactorAuth/Exceptions/ForbiddenRequestErrorException.cs rename to Bandwidth.Standard/TwoFactorAuth/Exceptions/ForbiddenRequestException.cs index 05f2bc02..11217a36 100644 --- a/Bandwidth.Standard/MultiFactorAuth/Exceptions/ForbiddenRequestErrorException.cs +++ b/Bandwidth.Standard/TwoFactorAuth/Exceptions/ForbiddenRequestException.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -15,20 +14,20 @@ using Newtonsoft.Json.Converters; using Bandwidth.Standard.Http.Client; using Bandwidth.Standard.Exceptions; -using Bandwidth.Standard.MultiFactorAuth.Models; +using Bandwidth.Standard.TwoFactorAuth.Models; using Bandwidth.Standard; using Bandwidth.Standard.Utilities; -namespace Bandwidth.Standard.MultiFactorAuth.Exceptions +namespace Bandwidth.Standard.TwoFactorAuth.Exceptions { - public class ForbiddenRequestErrorException : ApiException + public class ForbiddenRequestException : ApiException { /// /// Initialization constructor /// /// The reason for throwing exception /// The HTTP context that encapsulates request and response objects - public ForbiddenRequestErrorException(string reason, HttpContext context) + public ForbiddenRequestException(string reason, HttpContext context) : base(reason, context) { } /// diff --git a/Bandwidth.Standard/MultiFactorAuth/Exceptions/UnauthorizedRequestErrorException.cs b/Bandwidth.Standard/TwoFactorAuth/Exceptions/UnauthorizedRequestException.cs similarity index 77% rename from Bandwidth.Standard/MultiFactorAuth/Exceptions/UnauthorizedRequestErrorException.cs rename to Bandwidth.Standard/TwoFactorAuth/Exceptions/UnauthorizedRequestException.cs index 4f80f4d9..79293467 100644 --- a/Bandwidth.Standard/MultiFactorAuth/Exceptions/UnauthorizedRequestErrorException.cs +++ b/Bandwidth.Standard/TwoFactorAuth/Exceptions/UnauthorizedRequestException.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -15,20 +14,20 @@ using Newtonsoft.Json.Converters; using Bandwidth.Standard.Http.Client; using Bandwidth.Standard.Exceptions; -using Bandwidth.Standard.MultiFactorAuth.Models; +using Bandwidth.Standard.TwoFactorAuth.Models; using Bandwidth.Standard; using Bandwidth.Standard.Utilities; -namespace Bandwidth.Standard.MultiFactorAuth.Exceptions +namespace Bandwidth.Standard.TwoFactorAuth.Exceptions { - public class UnauthorizedRequestErrorException : ApiException + public class UnauthorizedRequestException : ApiException { /// /// Initialization constructor /// /// The reason for throwing exception /// The HTTP context that encapsulates request and response objects - public UnauthorizedRequestErrorException(string reason, HttpContext context) + public UnauthorizedRequestException(string reason, HttpContext context) : base(reason, context) { } /// diff --git a/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorCodeRequestSchema.cs b/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorCodeRequestSchema.cs new file mode 100644 index 00000000..dd092bca --- /dev/null +++ b/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorCodeRequestSchema.cs @@ -0,0 +1,76 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.TwoFactorAuth.Models +{ + public class TwoFactorCodeRequestSchema + { + public TwoFactorCodeRequestSchema() { } + + public TwoFactorCodeRequestSchema(string to, + string from, + string applicationId, + string message, + double digits, + string scope = null) + { + To = to; + From = from; + ApplicationId = applicationId; + Scope = scope; + Message = message; + Digits = digits; + } + + /// + /// The phone number to send the 2fa code to. + /// + [JsonProperty("to")] + public string To { get; set; } + + /// + /// The application phone number, the sender of the 2fa code. + /// + [JsonProperty("from")] + public string From { get; set; } + + /// + /// The application unique ID, obtained from Bandwidth. + /// + [JsonProperty("applicationId")] + public string ApplicationId { get; set; } + + /// + /// An optional field to denote what scope or action the 2fa code is addressing. If not supplied, defaults to "2FA". + /// + [JsonProperty("scope", NullValueHandling = NullValueHandling.Ignore)] + public string Scope { get; set; } + + /// + /// The message format of the 2fa code. There are three values that the system will replace "{CODE}", "{NAME}", "{SCOPE}". The "{SCOPE}" and "{NAME} value template are optional, while "{CODE}" must be supplied. As the name would suggest, code will be replace with the actual 2fa code. Name is replaced with the application name, configured during provisioning of 2fa. The scope value is the same value sent during the call and partitioned by the server. + /// + [JsonProperty("message")] + public string Message { get; set; } + + /// + /// The number of digits for your 2fa code. The valid number ranges from 2 to 8, inclusively. + /// + [JsonProperty("digits")] + public double Digits { get; set; } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorMessagingResponse.cs b/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorMessagingResponse.cs new file mode 100644 index 00000000..8de4f102 --- /dev/null +++ b/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorMessagingResponse.cs @@ -0,0 +1,36 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.TwoFactorAuth.Models +{ + public class TwoFactorMessagingResponse + { + public TwoFactorMessagingResponse() { } + + public TwoFactorMessagingResponse(string messageId = null) + { + MessageId = messageId; + } + + /// + /// Getter for messageId + /// + [JsonProperty("messageId", NullValueHandling = NullValueHandling.Ignore)] + public string MessageId { get; set; } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVerifyCodeResponse.cs b/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVerifyCodeResponse.cs new file mode 100644 index 00000000..d06ddb2b --- /dev/null +++ b/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVerifyCodeResponse.cs @@ -0,0 +1,36 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.TwoFactorAuth.Models +{ + public class TwoFactorVerifyCodeResponse + { + public TwoFactorVerifyCodeResponse() { } + + public TwoFactorVerifyCodeResponse(bool? valid = null) + { + Valid = valid; + } + + /// + /// Getter for valid + /// + [JsonProperty("valid", NullValueHandling = NullValueHandling.Ignore)] + public bool? Valid { get; set; } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVerifyRequestSchema.cs b/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVerifyRequestSchema.cs new file mode 100644 index 00000000..56beddaf --- /dev/null +++ b/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVerifyRequestSchema.cs @@ -0,0 +1,68 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.TwoFactorAuth.Models +{ + public class TwoFactorVerifyRequestSchema + { + public TwoFactorVerifyRequestSchema() { } + + public TwoFactorVerifyRequestSchema(string to, + string applicationId, + double expirationTimeInMinutes, + string code, + string scope = null) + { + To = to; + ApplicationId = applicationId; + Scope = scope; + ExpirationTimeInMinutes = expirationTimeInMinutes; + Code = code; + } + + /// + /// The phone number to send the 2fa code to. + /// + [JsonProperty("to")] + public string To { get; set; } + + /// + /// The application unique ID, obtained from Bandwidth. + /// + [JsonProperty("applicationId")] + public string ApplicationId { get; set; } + + /// + /// An optional field to denote what scope or action the 2fa code is addressing. If not supplied, defaults to "2FA". + /// + [JsonProperty("scope", NullValueHandling = NullValueHandling.Ignore)] + public string Scope { get; set; } + + /// + /// The time period, in minutes, to validate the 2fa code. By setting this to 3 minutes, it will mean any code generated within the last 3 minutes are still valid. The valid range for expiration time is between 0 and 15 minutes, exclusively and inclusively, respectively. + /// + [JsonProperty("expirationTimeInMinutes")] + public double ExpirationTimeInMinutes { get; set; } + + /// + /// The generated 2fa code to check if valid + /// + [JsonProperty("code")] + public string Code { get; set; } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVoiceResponse.cs b/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVoiceResponse.cs new file mode 100644 index 00000000..a6feccf7 --- /dev/null +++ b/Bandwidth.Standard/TwoFactorAuth/Models/TwoFactorVoiceResponse.cs @@ -0,0 +1,36 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.TwoFactorAuth.Models +{ + public class TwoFactorVoiceResponse + { + public TwoFactorVoiceResponse() { } + + public TwoFactorVoiceResponse(string callId = null) + { + CallId = callId; + } + + /// + /// Getter for callId + /// + [JsonProperty("callId", NullValueHandling = NullValueHandling.Ignore)] + public string CallId { get; set; } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/MultiFactorAuth/MultiFactorAuthClient.cs b/Bandwidth.Standard/TwoFactorAuth/TwoFactorAuthClient.cs similarity index 78% rename from Bandwidth.Standard/MultiFactorAuth/MultiFactorAuthClient.cs rename to Bandwidth.Standard/TwoFactorAuth/TwoFactorAuthClient.cs index 67d283c2..9244c69d 100644 --- a/Bandwidth.Standard/MultiFactorAuth/MultiFactorAuthClient.cs +++ b/Bandwidth.Standard/TwoFactorAuth/TwoFactorAuthClient.cs @@ -4,11 +4,11 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ using System; -using Bandwidth.Standard.MultiFactorAuth.Controllers; +using Bandwidth.Standard.TwoFactorAuth.Controllers; -namespace Bandwidth.Standard.MultiFactorAuth +namespace Bandwidth.Standard.TwoFactorAuth { - public sealed class MultiFactorAuthClient + public sealed class TwoFactorAuthClient { private readonly BandwidthClient bandwidthClient; private readonly Lazy mFA; @@ -22,7 +22,7 @@ public sealed class MultiFactorAuthClient /// /// Default constructor /// - public MultiFactorAuthClient(BandwidthClient bandwidthClient) + public TwoFactorAuthClient(BandwidthClient bandwidthClient) { this.bandwidthClient = bandwidthClient; mFA = new Lazy( diff --git a/Bandwidth.Standard/Voice/Controllers/APIController.cs b/Bandwidth.Standard/Voice/Controllers/APIController.cs index 10e241a7..5e0c5e19 100644 --- a/Bandwidth.Standard/Voice/Controllers/APIController.cs +++ b/Bandwidth.Standard/Voice/Controllers/APIController.cs @@ -96,7 +96,7 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -106,27 +106,27 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -200,7 +200,7 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -210,27 +210,27 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -308,7 +308,7 @@ public async Task ModifyCallAsync(string accountId, string callId, Models.ApiMod //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -318,27 +318,27 @@ public async Task ModifyCallAsync(string accountId, string callId, Models.ApiMod if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -413,7 +413,7 @@ public async Task ModifyCallRecordingStateAsync(string accountId, string callId, //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -423,27 +423,27 @@ public async Task ModifyCallRecordingStateAsync(string accountId, string callId, if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -514,7 +514,7 @@ public async Task ModifyCallRecordingStateAsync(string accountId, string callId, //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -524,27 +524,27 @@ public async Task ModifyCallRecordingStateAsync(string accountId, string callId, if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -621,7 +621,7 @@ public async Task ModifyCallRecordingStateAsync(string accountId, string callId, //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -631,27 +631,27 @@ public async Task ModifyCallRecordingStateAsync(string accountId, string callId, if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -726,7 +726,7 @@ public async Task DeleteRecordingAsync(string accountId, string callId, string r //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -736,27 +736,27 @@ public async Task DeleteRecordingAsync(string accountId, string callId, string r if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -829,7 +829,7 @@ public async Task> GetStreamRecordingMediaAsync(string accou //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -839,27 +839,27 @@ public async Task> GetStreamRecordingMediaAsync(string accou if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -934,7 +934,7 @@ public async Task DeleteRecordingMediaAsync(string accountId, string callId, str //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -944,27 +944,27 @@ public async Task DeleteRecordingMediaAsync(string accountId, string callId, str if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1038,7 +1038,7 @@ public async Task DeleteRecordingMediaAsync(string accountId, string callId, str //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1048,27 +1048,27 @@ public async Task DeleteRecordingMediaAsync(string accountId, string callId, str if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1157,7 +1157,7 @@ public async Task CreateTranscribeRecordingAsync( //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1167,32 +1167,32 @@ public async Task CreateTranscribeRecordingAsync( if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 410) { - throw new ApiErrorResponseErrorException("The media for this recording has been deleted, so we can't transcribe it", _context); + throw new ApiErrorResponseException("The media for this recording has been deleted, so we can't transcribe it", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1264,7 +1264,7 @@ public async Task DeleteRecordingTranscriptionAsync(string accountId, string cal //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1274,27 +1274,27 @@ public async Task DeleteRecordingTranscriptionAsync(string accountId, string cal if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1394,7 +1394,7 @@ public async Task DeleteRecordingTranscriptionAsync(string accountId, string cal //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1404,27 +1404,27 @@ public async Task DeleteRecordingTranscriptionAsync(string accountId, string cal if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1498,7 +1498,7 @@ public async Task DeleteRecordingTranscriptionAsync(string accountId, string cal //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1508,27 +1508,27 @@ public async Task DeleteRecordingTranscriptionAsync(string accountId, string cal if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1606,7 +1606,7 @@ public async Task ModifyConferenceAsync(string accountId, string conferenceId, M //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1616,27 +1616,27 @@ public async Task ModifyConferenceAsync(string accountId, string conferenceId, M if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1722,7 +1722,7 @@ public async Task ModifyConferenceMemberAsync( //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1732,27 +1732,27 @@ public async Task ModifyConferenceMemberAsync( if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1826,7 +1826,7 @@ public async Task ModifyConferenceMemberAsync( //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1836,27 +1836,27 @@ public async Task ModifyConferenceMemberAsync( if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -1930,7 +1930,7 @@ public async Task ModifyConferenceMemberAsync( //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -1940,27 +1940,27 @@ public async Task ModifyConferenceMemberAsync( if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -2037,7 +2037,7 @@ public async Task ModifyConferenceMemberAsync( //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -2047,27 +2047,27 @@ public async Task ModifyConferenceMemberAsync( if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -2143,7 +2143,7 @@ public async Task> GetStreamConferenceRecordingMediaAsync(st //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -2153,27 +2153,27 @@ public async Task> GetStreamConferenceRecordingMediaAsync(st if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level @@ -2271,7 +2271,7 @@ public async Task> GetStreamConferenceRecordingMediaAsync(st //Error handling using HTTP status codes if (_response.StatusCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", _context); } if (_response.StatusCode == 401) @@ -2281,27 +2281,27 @@ public async Task> GetStreamConferenceRecordingMediaAsync(st if (_response.StatusCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", _context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", _context); } if (_response.StatusCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", _context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", _context); } if (_response.StatusCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", _context); } if (_response.StatusCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", _context); } if (_response.StatusCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", _context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", _context); } //handle errors defined at the API level diff --git a/Bandwidth.Standard/Voice/Exceptions/ApiErrorResponseException.cs b/Bandwidth.Standard/Voice/Exceptions/ApiErrorResponseException.cs new file mode 100644 index 00000000..954a0048 --- /dev/null +++ b/Bandwidth.Standard/Voice/Exceptions/ApiErrorResponseException.cs @@ -0,0 +1,52 @@ +/* + * Bandwidth.Standard + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Bandwidth.Standard.Http.Client; +using Bandwidth.Standard.Exceptions; +using Bandwidth.Standard.Voice.Models; +using Bandwidth.Standard; +using Bandwidth.Standard.Utilities; + +namespace Bandwidth.Standard.Voice.Exceptions +{ + public class ApiErrorResponseException : ApiException + { + /// + /// Initialization constructor + /// + /// The reason for throwing exception + /// The HTTP context that encapsulates request and response objects + public ApiErrorResponseException(string reason, HttpContext context) + : base(reason, context) { } + + /// + /// Getter for type + /// + [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)] + public string Type { get; set; } + + /// + /// Getter for description + /// + [JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)] + public string Description { get; set; } + + /// + /// Getter for id + /// + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + } +} \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ApiCallResponse.cs b/Bandwidth.Standard/Voice/Models/ApiCallResponse.cs index dd8a7a74..c2b9a702 100644 --- a/Bandwidth.Standard/Voice/Models/ApiCallResponse.cs +++ b/Bandwidth.Standard/Voice/Models/ApiCallResponse.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -186,172 +185,5 @@ public ApiCallResponse(string accountId, [JsonProperty("tag", NullValueHandling = NullValueHandling.Ignore)] public string Tag { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"ApiCallResponse : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"AccountId = {(AccountId == null ? "null" : AccountId == string.Empty ? "" : AccountId)}"); - toStringOutput.Add($"CallId = {(CallId == null ? "null" : CallId == string.Empty ? "" : CallId)}"); - toStringOutput.Add($"ApplicationId = {(ApplicationId == null ? "null" : ApplicationId == string.Empty ? "" : ApplicationId)}"); - toStringOutput.Add($"To = {(To == null ? "null" : To == string.Empty ? "" : To)}"); - toStringOutput.Add($"From = {(From == null ? "null" : From == string.Empty ? "" : From)}"); - toStringOutput.Add($"StartTime = {(StartTime == null ? "null" : StartTime.ToString())}"); - toStringOutput.Add($"CallUrl = {(CallUrl == null ? "null" : CallUrl == string.Empty ? "" : CallUrl)}"); - toStringOutput.Add($"CallTimeout = {(CallTimeout == null ? "null" : CallTimeout.ToString())}"); - toStringOutput.Add($"CallbackTimeout = {(CallbackTimeout == null ? "null" : CallbackTimeout.ToString())}"); - toStringOutput.Add($"AnswerUrl = {(AnswerUrl == null ? "null" : AnswerUrl == string.Empty ? "" : AnswerUrl)}"); - toStringOutput.Add($"AnswerMethod = {AnswerMethod}"); - toStringOutput.Add($"AnswerFallbackUrl = {(AnswerFallbackUrl == null ? "null" : AnswerFallbackUrl == string.Empty ? "" : AnswerFallbackUrl)}"); - toStringOutput.Add($"AnswerFallbackMethod = {(AnswerFallbackMethod == null ? "null" : AnswerFallbackMethod.ToString())}"); - toStringOutput.Add($"DisconnectUrl = {(DisconnectUrl == null ? "null" : DisconnectUrl == string.Empty ? "" : DisconnectUrl)}"); - toStringOutput.Add($"DisconnectMethod = {DisconnectMethod}"); - toStringOutput.Add($"Username = {(Username == null ? "null" : Username == string.Empty ? "" : Username)}"); - toStringOutput.Add($"Password = {(Password == null ? "null" : Password == string.Empty ? "" : Password)}"); - toStringOutput.Add($"FallbackUsername = {(FallbackUsername == null ? "null" : FallbackUsername == string.Empty ? "" : FallbackUsername)}"); - toStringOutput.Add($"FallbackPassword = {(FallbackPassword == null ? "null" : FallbackPassword == string.Empty ? "" : FallbackPassword)}"); - toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is ApiCallResponse other && - ((AccountId == null && other.AccountId == null) || (AccountId?.Equals(other.AccountId) == true)) && - ((CallId == null && other.CallId == null) || (CallId?.Equals(other.CallId) == true)) && - ((ApplicationId == null && other.ApplicationId == null) || (ApplicationId?.Equals(other.ApplicationId) == true)) && - ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && - ((From == null && other.From == null) || (From?.Equals(other.From) == true)) && - ((StartTime == null && other.StartTime == null) || (StartTime?.Equals(other.StartTime) == true)) && - ((CallUrl == null && other.CallUrl == null) || (CallUrl?.Equals(other.CallUrl) == true)) && - ((CallTimeout == null && other.CallTimeout == null) || (CallTimeout?.Equals(other.CallTimeout) == true)) && - ((CallbackTimeout == null && other.CallbackTimeout == null) || (CallbackTimeout?.Equals(other.CallbackTimeout) == true)) && - ((AnswerUrl == null && other.AnswerUrl == null) || (AnswerUrl?.Equals(other.AnswerUrl) == true)) && - AnswerMethod.Equals(other.AnswerMethod) && - ((AnswerFallbackUrl == null && other.AnswerFallbackUrl == null) || (AnswerFallbackUrl?.Equals(other.AnswerFallbackUrl) == true)) && - ((AnswerFallbackMethod == null && other.AnswerFallbackMethod == null) || (AnswerFallbackMethod?.Equals(other.AnswerFallbackMethod) == true)) && - ((DisconnectUrl == null && other.DisconnectUrl == null) || (DisconnectUrl?.Equals(other.DisconnectUrl) == true)) && - DisconnectMethod.Equals(other.DisconnectMethod) && - ((Username == null && other.Username == null) || (Username?.Equals(other.Username) == true)) && - ((Password == null && other.Password == null) || (Password?.Equals(other.Password) == true)) && - ((FallbackUsername == null && other.FallbackUsername == null) || (FallbackUsername?.Equals(other.FallbackUsername) == true)) && - ((FallbackPassword == null && other.FallbackPassword == null) || (FallbackPassword?.Equals(other.FallbackPassword) == true)) && - ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)); - } - - public override int GetHashCode() - { - int hashCode = 1215759600; - - if (AccountId != null) - { - hashCode += AccountId.GetHashCode(); - } - - if (CallId != null) - { - hashCode += CallId.GetHashCode(); - } - - if (ApplicationId != null) - { - hashCode += ApplicationId.GetHashCode(); - } - - if (To != null) - { - hashCode += To.GetHashCode(); - } - - if (From != null) - { - hashCode += From.GetHashCode(); - } - - if (StartTime != null) - { - hashCode += StartTime.GetHashCode(); - } - - if (CallUrl != null) - { - hashCode += CallUrl.GetHashCode(); - } - - if (CallTimeout != null) - { - hashCode += CallTimeout.GetHashCode(); - } - - if (CallbackTimeout != null) - { - hashCode += CallbackTimeout.GetHashCode(); - } - - if (AnswerUrl != null) - { - hashCode += AnswerUrl.GetHashCode(); - } - hashCode += AnswerMethod.GetHashCode(); - - if (AnswerFallbackUrl != null) - { - hashCode += AnswerFallbackUrl.GetHashCode(); - } - - if (AnswerFallbackMethod != null) - { - hashCode += AnswerFallbackMethod.GetHashCode(); - } - - if (DisconnectUrl != null) - { - hashCode += DisconnectUrl.GetHashCode(); - } - hashCode += DisconnectMethod.GetHashCode(); - - if (Username != null) - { - hashCode += Username.GetHashCode(); - } - - if (Password != null) - { - hashCode += Password.GetHashCode(); - } - - if (FallbackUsername != null) - { - hashCode += FallbackUsername.GetHashCode(); - } - - if (FallbackPassword != null) - { - hashCode += FallbackPassword.GetHashCode(); - } - - if (Tag != null) - { - hashCode += Tag.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ApiCallStateResponse.cs b/Bandwidth.Standard/Voice/Models/ApiCallStateResponse.cs index 14d6be47..7503af3f 100644 --- a/Bandwidth.Standard/Voice/Models/ApiCallStateResponse.cs +++ b/Bandwidth.Standard/Voice/Models/ApiCallStateResponse.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -30,8 +29,6 @@ public ApiCallStateResponse(string callId = null, string from = null, string direction = null, Models.StateEnum? state = null, - string identity = null, - Dictionary pai = null, DateTime? startTime = null, DateTime? answerTime = null, DateTime? endTime = null, @@ -48,8 +45,6 @@ public ApiCallStateResponse(string callId = null, From = from; Direction = direction; State = state; - Identity = identity; - Pai = pai; StartTime = startTime; AnswerTime = answerTime; EndTime = endTime; @@ -107,18 +102,6 @@ public ApiCallStateResponse(string callId = null, [JsonProperty("state", ItemConverterType = typeof(StringValuedEnumConverter), NullValueHandling = NullValueHandling.Ignore)] public Models.StateEnum? State { get; set; } - /// - /// Getter for identity - /// - [JsonProperty("identity", NullValueHandling = NullValueHandling.Ignore)] - public string Identity { get; set; } - - /// - /// Getter for pai - /// - [JsonProperty("pai", NullValueHandling = NullValueHandling.Ignore)] - public Dictionary Pai { get; set; } - /// /// Getter for startTime /// @@ -165,159 +148,5 @@ public ApiCallStateResponse(string callId = null, [JsonProperty("lastUpdate", NullValueHandling = NullValueHandling.Ignore)] public DateTime? LastUpdate { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"ApiCallStateResponse : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"CallId = {(CallId == null ? "null" : CallId == string.Empty ? "" : CallId)}"); - toStringOutput.Add($"ParentCallId = {(ParentCallId == null ? "null" : ParentCallId == string.Empty ? "" : ParentCallId)}"); - toStringOutput.Add($"ApplicationId = {(ApplicationId == null ? "null" : ApplicationId == string.Empty ? "" : ApplicationId)}"); - toStringOutput.Add($"AccountId = {(AccountId == null ? "null" : AccountId == string.Empty ? "" : AccountId)}"); - toStringOutput.Add($"To = {(To == null ? "null" : To == string.Empty ? "" : To)}"); - toStringOutput.Add($"From = {(From == null ? "null" : From == string.Empty ? "" : From)}"); - toStringOutput.Add($"Direction = {(Direction == null ? "null" : Direction == string.Empty ? "" : Direction)}"); - toStringOutput.Add($"State = {(State == null ? "null" : State.ToString())}"); - toStringOutput.Add($"Identity = {(Identity == null ? "null" : Identity == string.Empty ? "" : Identity)}"); - toStringOutput.Add($"Pai = {(Pai == null ? "null" : Pai.ToString())}"); - toStringOutput.Add($"StartTime = {(StartTime == null ? "null" : StartTime.ToString())}"); - toStringOutput.Add($"AnswerTime = {(AnswerTime == null ? "null" : AnswerTime.ToString())}"); - toStringOutput.Add($"EndTime = {(EndTime == null ? "null" : EndTime.ToString())}"); - toStringOutput.Add($"DisconnectCause = {(DisconnectCause == null ? "null" : DisconnectCause.ToString())}"); - toStringOutput.Add($"ErrorMessage = {(ErrorMessage == null ? "null" : ErrorMessage == string.Empty ? "" : ErrorMessage)}"); - toStringOutput.Add($"ErrorId = {(ErrorId == null ? "null" : ErrorId == string.Empty ? "" : ErrorId)}"); - toStringOutput.Add($"LastUpdate = {(LastUpdate == null ? "null" : LastUpdate.ToString())}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is ApiCallStateResponse other && - ((CallId == null && other.CallId == null) || (CallId?.Equals(other.CallId) == true)) && - ((ParentCallId == null && other.ParentCallId == null) || (ParentCallId?.Equals(other.ParentCallId) == true)) && - ((ApplicationId == null && other.ApplicationId == null) || (ApplicationId?.Equals(other.ApplicationId) == true)) && - ((AccountId == null && other.AccountId == null) || (AccountId?.Equals(other.AccountId) == true)) && - ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && - ((From == null && other.From == null) || (From?.Equals(other.From) == true)) && - ((Direction == null && other.Direction == null) || (Direction?.Equals(other.Direction) == true)) && - ((State == null && other.State == null) || (State?.Equals(other.State) == true)) && - ((Identity == null && other.Identity == null) || (Identity?.Equals(other.Identity) == true)) && - ((Pai == null && other.Pai == null) || (Pai?.Equals(other.Pai) == true)) && - ((StartTime == null && other.StartTime == null) || (StartTime?.Equals(other.StartTime) == true)) && - ((AnswerTime == null && other.AnswerTime == null) || (AnswerTime?.Equals(other.AnswerTime) == true)) && - ((EndTime == null && other.EndTime == null) || (EndTime?.Equals(other.EndTime) == true)) && - ((DisconnectCause == null && other.DisconnectCause == null) || (DisconnectCause?.Equals(other.DisconnectCause) == true)) && - ((ErrorMessage == null && other.ErrorMessage == null) || (ErrorMessage?.Equals(other.ErrorMessage) == true)) && - ((ErrorId == null && other.ErrorId == null) || (ErrorId?.Equals(other.ErrorId) == true)) && - ((LastUpdate == null && other.LastUpdate == null) || (LastUpdate?.Equals(other.LastUpdate) == true)); - } - - public override int GetHashCode() - { - int hashCode = -1002659328; - - if (CallId != null) - { - hashCode += CallId.GetHashCode(); - } - - if (ParentCallId != null) - { - hashCode += ParentCallId.GetHashCode(); - } - - if (ApplicationId != null) - { - hashCode += ApplicationId.GetHashCode(); - } - - if (AccountId != null) - { - hashCode += AccountId.GetHashCode(); - } - - if (To != null) - { - hashCode += To.GetHashCode(); - } - - if (From != null) - { - hashCode += From.GetHashCode(); - } - - if (Direction != null) - { - hashCode += Direction.GetHashCode(); - } - - if (State != null) - { - hashCode += State.GetHashCode(); - } - - if (Identity != null) - { - hashCode += Identity.GetHashCode(); - } - - if (Pai != null) - { - hashCode += Pai.GetHashCode(); - } - - if (StartTime != null) - { - hashCode += StartTime.GetHashCode(); - } - - if (AnswerTime != null) - { - hashCode += AnswerTime.GetHashCode(); - } - - if (EndTime != null) - { - hashCode += EndTime.GetHashCode(); - } - - if (DisconnectCause != null) - { - hashCode += DisconnectCause.GetHashCode(); - } - - if (ErrorMessage != null) - { - hashCode += ErrorMessage.GetHashCode(); - } - - if (ErrorId != null) - { - hashCode += ErrorId.GetHashCode(); - } - - if (LastUpdate != null) - { - hashCode += LastUpdate.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ApiCreateCallRequest.cs b/Bandwidth.Standard/Voice/Models/ApiCreateCallRequest.cs index 0a84acd6..a0fcaa7c 100644 --- a/Bandwidth.Standard/Voice/Models/ApiCreateCallRequest.cs +++ b/Bandwidth.Standard/Voice/Models/ApiCreateCallRequest.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -177,173 +176,5 @@ public ApiCreateCallRequest(string from, [JsonProperty("obfuscatedFrom", NullValueHandling = NullValueHandling.Ignore)] public string ObfuscatedFrom { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"ApiCreateCallRequest : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"From = {(From == null ? "null" : From == string.Empty ? "" : From)}"); - toStringOutput.Add($"To = {(To == null ? "null" : To == string.Empty ? "" : To)}"); - toStringOutput.Add($"Uui = {(Uui == null ? "null" : Uui == string.Empty ? "" : Uui)}"); - toStringOutput.Add($"CallTimeout = {(CallTimeout == null ? "null" : CallTimeout.ToString())}"); - toStringOutput.Add($"CallbackTimeout = {(CallbackTimeout == null ? "null" : CallbackTimeout.ToString())}"); - toStringOutput.Add($"AnswerUrl = {(AnswerUrl == null ? "null" : AnswerUrl == string.Empty ? "" : AnswerUrl)}"); - toStringOutput.Add($"AnswerFallbackUrl = {(AnswerFallbackUrl == null ? "null" : AnswerFallbackUrl == string.Empty ? "" : AnswerFallbackUrl)}"); - toStringOutput.Add($"Username = {(Username == null ? "null" : Username == string.Empty ? "" : Username)}"); - toStringOutput.Add($"Password = {(Password == null ? "null" : Password == string.Empty ? "" : Password)}"); - toStringOutput.Add($"FallbackUsername = {(FallbackUsername == null ? "null" : FallbackUsername == string.Empty ? "" : FallbackUsername)}"); - toStringOutput.Add($"FallbackPassword = {(FallbackPassword == null ? "null" : FallbackPassword == string.Empty ? "" : FallbackPassword)}"); - toStringOutput.Add($"AnswerMethod = {(AnswerMethod == null ? "null" : AnswerMethod.ToString())}"); - toStringOutput.Add($"AnswerFallbackMethod = {(AnswerFallbackMethod == null ? "null" : AnswerFallbackMethod.ToString())}"); - toStringOutput.Add($"DisconnectUrl = {(DisconnectUrl == null ? "null" : DisconnectUrl == string.Empty ? "" : DisconnectUrl)}"); - toStringOutput.Add($"DisconnectMethod = {(DisconnectMethod == null ? "null" : DisconnectMethod.ToString())}"); - toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); - toStringOutput.Add($"ApplicationId = {(ApplicationId == null ? "null" : ApplicationId == string.Empty ? "" : ApplicationId)}"); - toStringOutput.Add($"ObfuscatedTo = {(ObfuscatedTo == null ? "null" : ObfuscatedTo == string.Empty ? "" : ObfuscatedTo)}"); - toStringOutput.Add($"ObfuscatedFrom = {(ObfuscatedFrom == null ? "null" : ObfuscatedFrom == string.Empty ? "" : ObfuscatedFrom)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is ApiCreateCallRequest other && - ((From == null && other.From == null) || (From?.Equals(other.From) == true)) && - ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && - ((Uui == null && other.Uui == null) || (Uui?.Equals(other.Uui) == true)) && - ((CallTimeout == null && other.CallTimeout == null) || (CallTimeout?.Equals(other.CallTimeout) == true)) && - ((CallbackTimeout == null && other.CallbackTimeout == null) || (CallbackTimeout?.Equals(other.CallbackTimeout) == true)) && - ((AnswerUrl == null && other.AnswerUrl == null) || (AnswerUrl?.Equals(other.AnswerUrl) == true)) && - ((AnswerFallbackUrl == null && other.AnswerFallbackUrl == null) || (AnswerFallbackUrl?.Equals(other.AnswerFallbackUrl) == true)) && - ((Username == null && other.Username == null) || (Username?.Equals(other.Username) == true)) && - ((Password == null && other.Password == null) || (Password?.Equals(other.Password) == true)) && - ((FallbackUsername == null && other.FallbackUsername == null) || (FallbackUsername?.Equals(other.FallbackUsername) == true)) && - ((FallbackPassword == null && other.FallbackPassword == null) || (FallbackPassword?.Equals(other.FallbackPassword) == true)) && - ((AnswerMethod == null && other.AnswerMethod == null) || (AnswerMethod?.Equals(other.AnswerMethod) == true)) && - ((AnswerFallbackMethod == null && other.AnswerFallbackMethod == null) || (AnswerFallbackMethod?.Equals(other.AnswerFallbackMethod) == true)) && - ((DisconnectUrl == null && other.DisconnectUrl == null) || (DisconnectUrl?.Equals(other.DisconnectUrl) == true)) && - ((DisconnectMethod == null && other.DisconnectMethod == null) || (DisconnectMethod?.Equals(other.DisconnectMethod) == true)) && - ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)) && - ((ApplicationId == null && other.ApplicationId == null) || (ApplicationId?.Equals(other.ApplicationId) == true)) && - ((ObfuscatedTo == null && other.ObfuscatedTo == null) || (ObfuscatedTo?.Equals(other.ObfuscatedTo) == true)) && - ((ObfuscatedFrom == null && other.ObfuscatedFrom == null) || (ObfuscatedFrom?.Equals(other.ObfuscatedFrom) == true)); - } - - public override int GetHashCode() - { - int hashCode = 1731410917; - - if (From != null) - { - hashCode += From.GetHashCode(); - } - - if (To != null) - { - hashCode += To.GetHashCode(); - } - - if (Uui != null) - { - hashCode += Uui.GetHashCode(); - } - - if (CallTimeout != null) - { - hashCode += CallTimeout.GetHashCode(); - } - - if (CallbackTimeout != null) - { - hashCode += CallbackTimeout.GetHashCode(); - } - - if (AnswerUrl != null) - { - hashCode += AnswerUrl.GetHashCode(); - } - - if (AnswerFallbackUrl != null) - { - hashCode += AnswerFallbackUrl.GetHashCode(); - } - - if (Username != null) - { - hashCode += Username.GetHashCode(); - } - - if (Password != null) - { - hashCode += Password.GetHashCode(); - } - - if (FallbackUsername != null) - { - hashCode += FallbackUsername.GetHashCode(); - } - - if (FallbackPassword != null) - { - hashCode += FallbackPassword.GetHashCode(); - } - - if (AnswerMethod != null) - { - hashCode += AnswerMethod.GetHashCode(); - } - - if (AnswerFallbackMethod != null) - { - hashCode += AnswerFallbackMethod.GetHashCode(); - } - - if (DisconnectUrl != null) - { - hashCode += DisconnectUrl.GetHashCode(); - } - - if (DisconnectMethod != null) - { - hashCode += DisconnectMethod.GetHashCode(); - } - - if (Tag != null) - { - hashCode += Tag.GetHashCode(); - } - - if (ApplicationId != null) - { - hashCode += ApplicationId.GetHashCode(); - } - - if (ObfuscatedTo != null) - { - hashCode += ObfuscatedTo.GetHashCode(); - } - - if (ObfuscatedFrom != null) - { - hashCode += ObfuscatedFrom.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ApiErrorResponse.cs b/Bandwidth.Standard/Voice/Models/ApiErrorResponse.cs deleted file mode 100644 index 260afad5..00000000 --- a/Bandwidth.Standard/Voice/Models/ApiErrorResponse.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.Voice.Models -{ - public class ApiErrorResponse - { - public ApiErrorResponse() { } - - public ApiErrorResponse(string type = null, - string description = null, - string id = null) - { - Type = type; - Description = description; - Id = id; - } - - /// - /// Getter for type - /// - [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)] - public string Type { get; set; } - - /// - /// Getter for description - /// - [JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)] - public string Description { get; set; } - - /// - /// Getter for id - /// - [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] - public string Id { get; set; } - - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"ApiErrorResponse : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Type = {(Type == null ? "null" : Type == string.Empty ? "" : Type)}"); - toStringOutput.Add($"Description = {(Description == null ? "null" : Description == string.Empty ? "" : Description)}"); - toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is ApiErrorResponse other && - ((Type == null && other.Type == null) || (Type?.Equals(other.Type) == true)) && - ((Description == null && other.Description == null) || (Description?.Equals(other.Description) == true)) && - ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)); - } - - public override int GetHashCode() - { - int hashCode = -1389149027; - - if (Type != null) - { - hashCode += Type.GetHashCode(); - } - - if (Description != null) - { - hashCode += Description.GetHashCode(); - } - - if (Id != null) - { - hashCode += Id.GetHashCode(); - } - - return hashCode; - } - - } -} \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ApiModifyCallRequest.cs b/Bandwidth.Standard/Voice/Models/ApiModifyCallRequest.cs index 73e30a56..22df79f9 100644 --- a/Bandwidth.Standard/Voice/Models/ApiModifyCallRequest.cs +++ b/Bandwidth.Standard/Voice/Models/ApiModifyCallRequest.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -105,110 +104,5 @@ public ApiModifyCallRequest(string redirectUrl, [JsonProperty("tag", NullValueHandling = NullValueHandling.Ignore)] public string Tag { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"ApiModifyCallRequest : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"State = {(State == null ? "null" : State.ToString())}"); - toStringOutput.Add($"RedirectUrl = {(RedirectUrl == null ? "null" : RedirectUrl == string.Empty ? "" : RedirectUrl)}"); - toStringOutput.Add($"RedirectFallbackUrl = {(RedirectFallbackUrl == null ? "null" : RedirectFallbackUrl == string.Empty ? "" : RedirectFallbackUrl)}"); - toStringOutput.Add($"RedirectMethod = {(RedirectMethod == null ? "null" : RedirectMethod.ToString())}"); - toStringOutput.Add($"RedirectFallbackMethod = {(RedirectFallbackMethod == null ? "null" : RedirectFallbackMethod.ToString())}"); - toStringOutput.Add($"Username = {(Username == null ? "null" : Username == string.Empty ? "" : Username)}"); - toStringOutput.Add($"Password = {(Password == null ? "null" : Password == string.Empty ? "" : Password)}"); - toStringOutput.Add($"FallbackUsername = {(FallbackUsername == null ? "null" : FallbackUsername == string.Empty ? "" : FallbackUsername)}"); - toStringOutput.Add($"FallbackPassword = {(FallbackPassword == null ? "null" : FallbackPassword == string.Empty ? "" : FallbackPassword)}"); - toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is ApiModifyCallRequest other && - ((State == null && other.State == null) || (State?.Equals(other.State) == true)) && - ((RedirectUrl == null && other.RedirectUrl == null) || (RedirectUrl?.Equals(other.RedirectUrl) == true)) && - ((RedirectFallbackUrl == null && other.RedirectFallbackUrl == null) || (RedirectFallbackUrl?.Equals(other.RedirectFallbackUrl) == true)) && - ((RedirectMethod == null && other.RedirectMethod == null) || (RedirectMethod?.Equals(other.RedirectMethod) == true)) && - ((RedirectFallbackMethod == null && other.RedirectFallbackMethod == null) || (RedirectFallbackMethod?.Equals(other.RedirectFallbackMethod) == true)) && - ((Username == null && other.Username == null) || (Username?.Equals(other.Username) == true)) && - ((Password == null && other.Password == null) || (Password?.Equals(other.Password) == true)) && - ((FallbackUsername == null && other.FallbackUsername == null) || (FallbackUsername?.Equals(other.FallbackUsername) == true)) && - ((FallbackPassword == null && other.FallbackPassword == null) || (FallbackPassword?.Equals(other.FallbackPassword) == true)) && - ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)); - } - - public override int GetHashCode() - { - int hashCode = 2064765237; - - if (State != null) - { - hashCode += State.GetHashCode(); - } - - if (RedirectUrl != null) - { - hashCode += RedirectUrl.GetHashCode(); - } - - if (RedirectFallbackUrl != null) - { - hashCode += RedirectFallbackUrl.GetHashCode(); - } - - if (RedirectMethod != null) - { - hashCode += RedirectMethod.GetHashCode(); - } - - if (RedirectFallbackMethod != null) - { - hashCode += RedirectFallbackMethod.GetHashCode(); - } - - if (Username != null) - { - hashCode += Username.GetHashCode(); - } - - if (Password != null) - { - hashCode += Password.GetHashCode(); - } - - if (FallbackUsername != null) - { - hashCode += FallbackUsername.GetHashCode(); - } - - if (FallbackPassword != null) - { - hashCode += FallbackPassword.GetHashCode(); - } - - if (Tag != null) - { - hashCode += Tag.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ApiModifyConferenceRequest.cs b/Bandwidth.Standard/Voice/Models/ApiModifyConferenceRequest.cs index e837992f..40ec3f85 100644 --- a/Bandwidth.Standard/Voice/Models/ApiModifyConferenceRequest.cs +++ b/Bandwidth.Standard/Voice/Models/ApiModifyConferenceRequest.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -97,103 +96,5 @@ public ApiModifyConferenceRequest(Models.StatusEnum? status = null, [JsonProperty("fallbackPassword", NullValueHandling = NullValueHandling.Ignore)] public string FallbackPassword { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"ApiModifyConferenceRequest : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Status = {(Status == null ? "null" : Status.ToString())}"); - toStringOutput.Add($"RedirectUrl = {(RedirectUrl == null ? "null" : RedirectUrl == string.Empty ? "" : RedirectUrl)}"); - toStringOutput.Add($"RedirectFallbackUrl = {(RedirectFallbackUrl == null ? "null" : RedirectFallbackUrl == string.Empty ? "" : RedirectFallbackUrl)}"); - toStringOutput.Add($"RedirectMethod = {(RedirectMethod == null ? "null" : RedirectMethod.ToString())}"); - toStringOutput.Add($"RedirectFallbackMethod = {(RedirectFallbackMethod == null ? "null" : RedirectFallbackMethod.ToString())}"); - toStringOutput.Add($"Username = {(Username == null ? "null" : Username == string.Empty ? "" : Username)}"); - toStringOutput.Add($"Password = {(Password == null ? "null" : Password == string.Empty ? "" : Password)}"); - toStringOutput.Add($"FallbackUsername = {(FallbackUsername == null ? "null" : FallbackUsername == string.Empty ? "" : FallbackUsername)}"); - toStringOutput.Add($"FallbackPassword = {(FallbackPassword == null ? "null" : FallbackPassword == string.Empty ? "" : FallbackPassword)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is ApiModifyConferenceRequest other && - ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true)) && - ((RedirectUrl == null && other.RedirectUrl == null) || (RedirectUrl?.Equals(other.RedirectUrl) == true)) && - ((RedirectFallbackUrl == null && other.RedirectFallbackUrl == null) || (RedirectFallbackUrl?.Equals(other.RedirectFallbackUrl) == true)) && - ((RedirectMethod == null && other.RedirectMethod == null) || (RedirectMethod?.Equals(other.RedirectMethod) == true)) && - ((RedirectFallbackMethod == null && other.RedirectFallbackMethod == null) || (RedirectFallbackMethod?.Equals(other.RedirectFallbackMethod) == true)) && - ((Username == null && other.Username == null) || (Username?.Equals(other.Username) == true)) && - ((Password == null && other.Password == null) || (Password?.Equals(other.Password) == true)) && - ((FallbackUsername == null && other.FallbackUsername == null) || (FallbackUsername?.Equals(other.FallbackUsername) == true)) && - ((FallbackPassword == null && other.FallbackPassword == null) || (FallbackPassword?.Equals(other.FallbackPassword) == true)); - } - - public override int GetHashCode() - { - int hashCode = -276202593; - - if (Status != null) - { - hashCode += Status.GetHashCode(); - } - - if (RedirectUrl != null) - { - hashCode += RedirectUrl.GetHashCode(); - } - - if (RedirectFallbackUrl != null) - { - hashCode += RedirectFallbackUrl.GetHashCode(); - } - - if (RedirectMethod != null) - { - hashCode += RedirectMethod.GetHashCode(); - } - - if (RedirectFallbackMethod != null) - { - hashCode += RedirectFallbackMethod.GetHashCode(); - } - - if (Username != null) - { - hashCode += Username.GetHashCode(); - } - - if (Password != null) - { - hashCode += Password.GetHashCode(); - } - - if (FallbackUsername != null) - { - hashCode += FallbackUsername.GetHashCode(); - } - - if (FallbackPassword != null) - { - hashCode += FallbackPassword.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ApiTranscribeRecordingRequest.cs b/Bandwidth.Standard/Voice/Models/ApiTranscribeRecordingRequest.cs index 256d80d0..773ca5d7 100644 --- a/Bandwidth.Standard/Voice/Models/ApiTranscribeRecordingRequest.cs +++ b/Bandwidth.Standard/Voice/Models/ApiTranscribeRecordingRequest.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -73,82 +72,5 @@ public ApiTranscribeRecordingRequest(string callbackUrl = null, [JsonProperty("callbackTimeout", NullValueHandling = NullValueHandling.Ignore)] public double? CallbackTimeout { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"ApiTranscribeRecordingRequest : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"CallbackUrl = {(CallbackUrl == null ? "null" : CallbackUrl == string.Empty ? "" : CallbackUrl)}"); - toStringOutput.Add($"CallbackMethod = {(CallbackMethod == null ? "null" : CallbackMethod.ToString())}"); - toStringOutput.Add($"Username = {(Username == null ? "null" : Username == string.Empty ? "" : Username)}"); - toStringOutput.Add($"Password = {(Password == null ? "null" : Password == string.Empty ? "" : Password)}"); - toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); - toStringOutput.Add($"CallbackTimeout = {(CallbackTimeout == null ? "null" : CallbackTimeout.ToString())}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is ApiTranscribeRecordingRequest other && - ((CallbackUrl == null && other.CallbackUrl == null) || (CallbackUrl?.Equals(other.CallbackUrl) == true)) && - ((CallbackMethod == null && other.CallbackMethod == null) || (CallbackMethod?.Equals(other.CallbackMethod) == true)) && - ((Username == null && other.Username == null) || (Username?.Equals(other.Username) == true)) && - ((Password == null && other.Password == null) || (Password?.Equals(other.Password) == true)) && - ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)) && - ((CallbackTimeout == null && other.CallbackTimeout == null) || (CallbackTimeout?.Equals(other.CallbackTimeout) == true)); - } - - public override int GetHashCode() - { - int hashCode = 1283937202; - - if (CallbackUrl != null) - { - hashCode += CallbackUrl.GetHashCode(); - } - - if (CallbackMethod != null) - { - hashCode += CallbackMethod.GetHashCode(); - } - - if (Username != null) - { - hashCode += Username.GetHashCode(); - } - - if (Password != null) - { - hashCode += Password.GetHashCode(); - } - - if (Tag != null) - { - hashCode += Tag.GetHashCode(); - } - - if (CallbackTimeout != null) - { - hashCode += CallbackTimeout.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ConferenceDetail.cs b/Bandwidth.Standard/Voice/Models/ConferenceDetail.cs index 252b4083..06e6f8ea 100644 --- a/Bandwidth.Standard/Voice/Models/ConferenceDetail.cs +++ b/Bandwidth.Standard/Voice/Models/ConferenceDetail.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -91,96 +90,5 @@ public ConferenceDetail(string id = null, [JsonProperty("activeMembers", NullValueHandling = NullValueHandling.Ignore)] public List ActiveMembers { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"ConferenceDetail : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}"); - toStringOutput.Add($"Name = {(Name == null ? "null" : Name == string.Empty ? "" : Name)}"); - toStringOutput.Add($"CreatedTime = {(CreatedTime == null ? "null" : CreatedTime.ToString())}"); - toStringOutput.Add($"CompletedTime = {(CompletedTime == null ? "null" : CompletedTime.ToString())}"); - toStringOutput.Add($"ConferenceEventUrl = {(ConferenceEventUrl == null ? "null" : ConferenceEventUrl == string.Empty ? "" : ConferenceEventUrl)}"); - toStringOutput.Add($"ConferenceEventMethod = {(ConferenceEventMethod == null ? "null" : ConferenceEventMethod.ToString())}"); - toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); - toStringOutput.Add($"ActiveMembers = {(ActiveMembers == null ? "null" : $"[{ string.Join(", ", ActiveMembers)} ]")}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is ConferenceDetail other && - ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) && - ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) && - ((CreatedTime == null && other.CreatedTime == null) || (CreatedTime?.Equals(other.CreatedTime) == true)) && - ((CompletedTime == null && other.CompletedTime == null) || (CompletedTime?.Equals(other.CompletedTime) == true)) && - ((ConferenceEventUrl == null && other.ConferenceEventUrl == null) || (ConferenceEventUrl?.Equals(other.ConferenceEventUrl) == true)) && - ((ConferenceEventMethod == null && other.ConferenceEventMethod == null) || (ConferenceEventMethod?.Equals(other.ConferenceEventMethod) == true)) && - ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)) && - ((ActiveMembers == null && other.ActiveMembers == null) || (ActiveMembers?.Equals(other.ActiveMembers) == true)); - } - - public override int GetHashCode() - { - int hashCode = 957632881; - - if (Id != null) - { - hashCode += Id.GetHashCode(); - } - - if (Name != null) - { - hashCode += Name.GetHashCode(); - } - - if (CreatedTime != null) - { - hashCode += CreatedTime.GetHashCode(); - } - - if (CompletedTime != null) - { - hashCode += CompletedTime.GetHashCode(); - } - - if (ConferenceEventUrl != null) - { - hashCode += ConferenceEventUrl.GetHashCode(); - } - - if (ConferenceEventMethod != null) - { - hashCode += ConferenceEventMethod.GetHashCode(); - } - - if (Tag != null) - { - hashCode += Tag.GetHashCode(); - } - - if (ActiveMembers != null) - { - hashCode += ActiveMembers.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ConferenceMemberDetail.cs b/Bandwidth.Standard/Voice/Models/ConferenceMemberDetail.cs index 4054b04f..3c2ccf0c 100644 --- a/Bandwidth.Standard/Voice/Models/ConferenceMemberDetail.cs +++ b/Bandwidth.Standard/Voice/Models/ConferenceMemberDetail.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -73,82 +72,5 @@ public ConferenceMemberDetail(string callId = null, [JsonProperty("callIdsToCoach", NullValueHandling = NullValueHandling.Ignore)] public List CallIdsToCoach { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"ConferenceMemberDetail : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"CallId = {(CallId == null ? "null" : CallId == string.Empty ? "" : CallId)}"); - toStringOutput.Add($"ConferenceId = {(ConferenceId == null ? "null" : ConferenceId == string.Empty ? "" : ConferenceId)}"); - toStringOutput.Add($"MemberUrl = {(MemberUrl == null ? "null" : MemberUrl == string.Empty ? "" : MemberUrl)}"); - toStringOutput.Add($"Mute = {(Mute == null ? "null" : Mute.ToString())}"); - toStringOutput.Add($"Hold = {(Hold == null ? "null" : Hold.ToString())}"); - toStringOutput.Add($"CallIdsToCoach = {(CallIdsToCoach == null ? "null" : $"[{ string.Join(", ", CallIdsToCoach)} ]")}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is ConferenceMemberDetail other && - ((CallId == null && other.CallId == null) || (CallId?.Equals(other.CallId) == true)) && - ((ConferenceId == null && other.ConferenceId == null) || (ConferenceId?.Equals(other.ConferenceId) == true)) && - ((MemberUrl == null && other.MemberUrl == null) || (MemberUrl?.Equals(other.MemberUrl) == true)) && - ((Mute == null && other.Mute == null) || (Mute?.Equals(other.Mute) == true)) && - ((Hold == null && other.Hold == null) || (Hold?.Equals(other.Hold) == true)) && - ((CallIdsToCoach == null && other.CallIdsToCoach == null) || (CallIdsToCoach?.Equals(other.CallIdsToCoach) == true)); - } - - public override int GetHashCode() - { - int hashCode = -736159189; - - if (CallId != null) - { - hashCode += CallId.GetHashCode(); - } - - if (ConferenceId != null) - { - hashCode += ConferenceId.GetHashCode(); - } - - if (MemberUrl != null) - { - hashCode += MemberUrl.GetHashCode(); - } - - if (Mute != null) - { - hashCode += Mute.GetHashCode(); - } - - if (Hold != null) - { - hashCode += Hold.GetHashCode(); - } - - if (CallIdsToCoach != null) - { - hashCode += CallIdsToCoach.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ConferenceRecordingMetadataResponse.cs b/Bandwidth.Standard/Voice/Models/ConferenceRecordingMetadataResponse.cs index dface26f..72b83074 100644 --- a/Bandwidth.Standard/Voice/Models/ConferenceRecordingMetadataResponse.cs +++ b/Bandwidth.Standard/Voice/Models/ConferenceRecordingMetadataResponse.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -115,117 +114,5 @@ public ConferenceRecordingMetadataResponse(string accountId = null, [JsonProperty("mediaUrl", NullValueHandling = NullValueHandling.Ignore)] public string MediaUrl { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"ConferenceRecordingMetadataResponse : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"AccountId = {(AccountId == null ? "null" : AccountId == string.Empty ? "" : AccountId)}"); - toStringOutput.Add($"ConferenceId = {(ConferenceId == null ? "null" : ConferenceId == string.Empty ? "" : ConferenceId)}"); - toStringOutput.Add($"Name = {(Name == null ? "null" : Name == string.Empty ? "" : Name)}"); - toStringOutput.Add($"RecordingId = {(RecordingId == null ? "null" : RecordingId == string.Empty ? "" : RecordingId)}"); - toStringOutput.Add($"Duration = {(Duration == null ? "null" : Duration == string.Empty ? "" : Duration)}"); - toStringOutput.Add($"Channels = {(Channels == null ? "null" : Channels.ToString())}"); - toStringOutput.Add($"StartTime = {(StartTime == null ? "null" : StartTime.ToString())}"); - toStringOutput.Add($"EndTime = {(EndTime == null ? "null" : EndTime.ToString())}"); - toStringOutput.Add($"FileFormat = {(FileFormat == null ? "null" : FileFormat.ToString())}"); - toStringOutput.Add($"Status = {(Status == null ? "null" : Status.ToString())}"); - toStringOutput.Add($"MediaUrl = {(MediaUrl == null ? "null" : MediaUrl == string.Empty ? "" : MediaUrl)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is ConferenceRecordingMetadataResponse other && - ((AccountId == null && other.AccountId == null) || (AccountId?.Equals(other.AccountId) == true)) && - ((ConferenceId == null && other.ConferenceId == null) || (ConferenceId?.Equals(other.ConferenceId) == true)) && - ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) && - ((RecordingId == null && other.RecordingId == null) || (RecordingId?.Equals(other.RecordingId) == true)) && - ((Duration == null && other.Duration == null) || (Duration?.Equals(other.Duration) == true)) && - ((Channels == null && other.Channels == null) || (Channels?.Equals(other.Channels) == true)) && - ((StartTime == null && other.StartTime == null) || (StartTime?.Equals(other.StartTime) == true)) && - ((EndTime == null && other.EndTime == null) || (EndTime?.Equals(other.EndTime) == true)) && - ((FileFormat == null && other.FileFormat == null) || (FileFormat?.Equals(other.FileFormat) == true)) && - ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true)) && - ((MediaUrl == null && other.MediaUrl == null) || (MediaUrl?.Equals(other.MediaUrl) == true)); - } - - public override int GetHashCode() - { - int hashCode = -898132204; - - if (AccountId != null) - { - hashCode += AccountId.GetHashCode(); - } - - if (ConferenceId != null) - { - hashCode += ConferenceId.GetHashCode(); - } - - if (Name != null) - { - hashCode += Name.GetHashCode(); - } - - if (RecordingId != null) - { - hashCode += RecordingId.GetHashCode(); - } - - if (Duration != null) - { - hashCode += Duration.GetHashCode(); - } - - if (Channels != null) - { - hashCode += Channels.GetHashCode(); - } - - if (StartTime != null) - { - hashCode += StartTime.GetHashCode(); - } - - if (EndTime != null) - { - hashCode += EndTime.GetHashCode(); - } - - if (FileFormat != null) - { - hashCode += FileFormat.GetHashCode(); - } - - if (Status != null) - { - hashCode += Status.GetHashCode(); - } - - if (MediaUrl != null) - { - hashCode += MediaUrl.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/ModifyCallRecordingState.cs b/Bandwidth.Standard/Voice/Models/ModifyCallRecordingState.cs index 1c3ca5c9..6746caee 100644 --- a/Bandwidth.Standard/Voice/Models/ModifyCallRecordingState.cs +++ b/Bandwidth.Standard/Voice/Models/ModifyCallRecordingState.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -33,43 +32,5 @@ public ModifyCallRecordingState(Models.State2Enum state) [JsonProperty("state", ItemConverterType = typeof(StringValuedEnumConverter))] public Models.State2Enum State { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"ModifyCallRecordingState : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"State = {State}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is ModifyCallRecordingState other && - State.Equals(other.State); - } - - public override int GetHashCode() - { - int hashCode = -1521564479; - hashCode += State.GetHashCode(); - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/RecordingMetadataResponse.cs b/Bandwidth.Standard/Voice/Models/RecordingMetadataResponse.cs index 579fb446..125bf296 100644 --- a/Bandwidth.Standard/Voice/Models/RecordingMetadataResponse.cs +++ b/Bandwidth.Standard/Voice/Models/RecordingMetadataResponse.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -171,166 +170,5 @@ public RecordingMetadataResponse(string applicationId = null, [JsonProperty("transcription", NullValueHandling = NullValueHandling.Ignore)] public Models.Transcription Transcription { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"RecordingMetadataResponse : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"ApplicationId = {(ApplicationId == null ? "null" : ApplicationId == string.Empty ? "" : ApplicationId)}"); - toStringOutput.Add($"AccountId = {(AccountId == null ? "null" : AccountId == string.Empty ? "" : AccountId)}"); - toStringOutput.Add($"CallId = {(CallId == null ? "null" : CallId == string.Empty ? "" : CallId)}"); - toStringOutput.Add($"ParentCallId = {(ParentCallId == null ? "null" : ParentCallId == string.Empty ? "" : ParentCallId)}"); - toStringOutput.Add($"RecordingId = {(RecordingId == null ? "null" : RecordingId == string.Empty ? "" : RecordingId)}"); - toStringOutput.Add($"To = {(To == null ? "null" : To == string.Empty ? "" : To)}"); - toStringOutput.Add($"From = {(From == null ? "null" : From == string.Empty ? "" : From)}"); - toStringOutput.Add($"TransferCallerId = {(TransferCallerId == null ? "null" : TransferCallerId == string.Empty ? "" : TransferCallerId)}"); - toStringOutput.Add($"TransferTo = {(TransferTo == null ? "null" : TransferTo == string.Empty ? "" : TransferTo)}"); - toStringOutput.Add($"Duration = {(Duration == null ? "null" : Duration == string.Empty ? "" : Duration)}"); - toStringOutput.Add($"Direction = {(Direction == null ? "null" : Direction.ToString())}"); - toStringOutput.Add($"Channels = {(Channels == null ? "null" : Channels.ToString())}"); - toStringOutput.Add($"StartTime = {(StartTime == null ? "null" : StartTime.ToString())}"); - toStringOutput.Add($"EndTime = {(EndTime == null ? "null" : EndTime.ToString())}"); - toStringOutput.Add($"FileFormat = {(FileFormat == null ? "null" : FileFormat.ToString())}"); - toStringOutput.Add($"Status = {(Status == null ? "null" : Status.ToString())}"); - toStringOutput.Add($"MediaUrl = {(MediaUrl == null ? "null" : MediaUrl == string.Empty ? "" : MediaUrl)}"); - toStringOutput.Add($"Transcription = {(Transcription == null ? "null" : Transcription.ToString())}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is RecordingMetadataResponse other && - ((ApplicationId == null && other.ApplicationId == null) || (ApplicationId?.Equals(other.ApplicationId) == true)) && - ((AccountId == null && other.AccountId == null) || (AccountId?.Equals(other.AccountId) == true)) && - ((CallId == null && other.CallId == null) || (CallId?.Equals(other.CallId) == true)) && - ((ParentCallId == null && other.ParentCallId == null) || (ParentCallId?.Equals(other.ParentCallId) == true)) && - ((RecordingId == null && other.RecordingId == null) || (RecordingId?.Equals(other.RecordingId) == true)) && - ((To == null && other.To == null) || (To?.Equals(other.To) == true)) && - ((From == null && other.From == null) || (From?.Equals(other.From) == true)) && - ((TransferCallerId == null && other.TransferCallerId == null) || (TransferCallerId?.Equals(other.TransferCallerId) == true)) && - ((TransferTo == null && other.TransferTo == null) || (TransferTo?.Equals(other.TransferTo) == true)) && - ((Duration == null && other.Duration == null) || (Duration?.Equals(other.Duration) == true)) && - ((Direction == null && other.Direction == null) || (Direction?.Equals(other.Direction) == true)) && - ((Channels == null && other.Channels == null) || (Channels?.Equals(other.Channels) == true)) && - ((StartTime == null && other.StartTime == null) || (StartTime?.Equals(other.StartTime) == true)) && - ((EndTime == null && other.EndTime == null) || (EndTime?.Equals(other.EndTime) == true)) && - ((FileFormat == null && other.FileFormat == null) || (FileFormat?.Equals(other.FileFormat) == true)) && - ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true)) && - ((MediaUrl == null && other.MediaUrl == null) || (MediaUrl?.Equals(other.MediaUrl) == true)) && - ((Transcription == null && other.Transcription == null) || (Transcription?.Equals(other.Transcription) == true)); - } - - public override int GetHashCode() - { - int hashCode = 1403073460; - - if (ApplicationId != null) - { - hashCode += ApplicationId.GetHashCode(); - } - - if (AccountId != null) - { - hashCode += AccountId.GetHashCode(); - } - - if (CallId != null) - { - hashCode += CallId.GetHashCode(); - } - - if (ParentCallId != null) - { - hashCode += ParentCallId.GetHashCode(); - } - - if (RecordingId != null) - { - hashCode += RecordingId.GetHashCode(); - } - - if (To != null) - { - hashCode += To.GetHashCode(); - } - - if (From != null) - { - hashCode += From.GetHashCode(); - } - - if (TransferCallerId != null) - { - hashCode += TransferCallerId.GetHashCode(); - } - - if (TransferTo != null) - { - hashCode += TransferTo.GetHashCode(); - } - - if (Duration != null) - { - hashCode += Duration.GetHashCode(); - } - - if (Direction != null) - { - hashCode += Direction.GetHashCode(); - } - - if (Channels != null) - { - hashCode += Channels.GetHashCode(); - } - - if (StartTime != null) - { - hashCode += StartTime.GetHashCode(); - } - - if (EndTime != null) - { - hashCode += EndTime.GetHashCode(); - } - - if (FileFormat != null) - { - hashCode += FileFormat.GetHashCode(); - } - - if (Status != null) - { - hashCode += Status.GetHashCode(); - } - - if (MediaUrl != null) - { - hashCode += MediaUrl.GetHashCode(); - } - - if (Transcription != null) - { - hashCode += Transcription.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/Transcript.cs b/Bandwidth.Standard/Voice/Models/Transcript.cs index 9bec21bb..607be6e9 100644 --- a/Bandwidth.Standard/Voice/Models/Transcript.cs +++ b/Bandwidth.Standard/Voice/Models/Transcript.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -41,54 +40,5 @@ public Transcript(string text = null, [JsonProperty("confidence", NullValueHandling = NullValueHandling.Ignore)] public double? Confidence { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"Transcript : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Text = {(Text == null ? "null" : Text == string.Empty ? "" : Text)}"); - toStringOutput.Add($"Confidence = {(Confidence == null ? "null" : Confidence.ToString())}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is Transcript other && - ((Text == null && other.Text == null) || (Text?.Equals(other.Text) == true)) && - ((Confidence == null && other.Confidence == null) || (Confidence?.Equals(other.Confidence) == true)); - } - - public override int GetHashCode() - { - int hashCode = 866752038; - - if (Text != null) - { - hashCode += Text.GetHashCode(); - } - - if (Confidence != null) - { - hashCode += Confidence.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/Transcription.cs b/Bandwidth.Standard/Voice/Models/Transcription.cs index fb58d00b..57e64c70 100644 --- a/Bandwidth.Standard/Voice/Models/Transcription.cs +++ b/Bandwidth.Standard/Voice/Models/Transcription.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -57,68 +56,5 @@ public Transcription(string id = null, [JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)] public string Url { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"Transcription : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}"); - toStringOutput.Add($"Status = {(Status == null ? "null" : Status.ToString())}"); - toStringOutput.Add($"CompletedTime = {(CompletedTime == null ? "null" : CompletedTime == string.Empty ? "" : CompletedTime)}"); - toStringOutput.Add($"Url = {(Url == null ? "null" : Url == string.Empty ? "" : Url)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is Transcription other && - ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) && - ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true)) && - ((CompletedTime == null && other.CompletedTime == null) || (CompletedTime?.Equals(other.CompletedTime) == true)) && - ((Url == null && other.Url == null) || (Url?.Equals(other.Url) == true)); - } - - public override int GetHashCode() - { - int hashCode = 732808726; - - if (Id != null) - { - hashCode += Id.GetHashCode(); - } - - if (Status != null) - { - hashCode += Status.GetHashCode(); - } - - if (CompletedTime != null) - { - hashCode += CompletedTime.GetHashCode(); - } - - if (Url != null) - { - hashCode += Url.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/Voice/Models/TranscriptionResponse.cs b/Bandwidth.Standard/Voice/Models/TranscriptionResponse.cs index 4756a479..18b1f4e9 100644 --- a/Bandwidth.Standard/Voice/Models/TranscriptionResponse.cs +++ b/Bandwidth.Standard/Voice/Models/TranscriptionResponse.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -33,47 +32,5 @@ public TranscriptionResponse(List transcripts = null) [JsonProperty("transcripts", NullValueHandling = NullValueHandling.Ignore)] public List Transcripts { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"TranscriptionResponse : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Transcripts = {(Transcripts == null ? "null" : $"[{ string.Join(", ", Transcripts)} ]")}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is TranscriptionResponse other && - ((Transcripts == null && other.Transcripts == null) || (Transcripts?.Equals(other.Transcripts) == true)); - } - - public override int GetHashCode() - { - int hashCode = -1678227722; - - if (Transcripts != null) - { - hashCode += Transcripts.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/WebRtc/Controllers/APIController.cs b/Bandwidth.Standard/WebRtc/Controllers/APIController.cs index 3a5b8e98..9ea25adc 100644 --- a/Bandwidth.Standard/WebRtc/Controllers/APIController.cs +++ b/Bandwidth.Standard/WebRtc/Controllers/APIController.cs @@ -113,7 +113,7 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorErrorException("Unexpected Error", _context); + throw new ErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -202,7 +202,7 @@ internal APIController(IConfiguration config, IHttpClient httpClient, IDictionar if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorErrorException("Unexpected Error", _context); + throw new ErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -289,7 +289,7 @@ public async Task DeleteParticipantAsync(string accountId, string participantId, if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorErrorException("Unexpected Error", _context); + throw new ErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -380,7 +380,7 @@ public async Task DeleteParticipantAsync(string accountId, string participantId, if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorErrorException("Unexpected Error", _context); + throw new ErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -469,7 +469,7 @@ public async Task DeleteParticipantAsync(string accountId, string participantId, if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorErrorException("Unexpected Error", _context); + throw new ErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -556,7 +556,7 @@ public async Task DeleteSessionAsync(string accountId, string sessionId, Cancell if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorErrorException("Unexpected Error", _context); + throw new ErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -642,7 +642,7 @@ public async Task DeleteSessionAsync(string accountId, string sessionId, Cancell if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorErrorException("Unexpected Error", _context); + throw new ErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -748,7 +748,7 @@ public async Task AddParticipantToSessionAsync( if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorErrorException("Unexpected Error", _context); + throw new ErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -837,7 +837,7 @@ public async Task RemoveParticipantFromSessionAsync(string accountId, string par if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorErrorException("Unexpected Error", _context); + throw new ErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -926,7 +926,7 @@ public async Task RemoveParticipantFromSessionAsync(string accountId, string par if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorErrorException("Unexpected Error", _context); + throw new ErrorException("Unexpected Error", _context); } //handle errors defined at the API level @@ -1037,7 +1037,7 @@ public async Task UpdateParticipantSubscriptionsAsync( if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK { - throw new ErrorErrorException("Unexpected Error", _context); + throw new ErrorException("Unexpected Error", _context); } //handle errors defined at the API level diff --git a/Bandwidth.Standard/WebRtc/Exceptions/ErrorErrorException.cs b/Bandwidth.Standard/WebRtc/Exceptions/ErrorException.cs similarity index 87% rename from Bandwidth.Standard/WebRtc/Exceptions/ErrorErrorException.cs rename to Bandwidth.Standard/WebRtc/Exceptions/ErrorException.cs index bf29ebba..3bf546cd 100644 --- a/Bandwidth.Standard/WebRtc/Exceptions/ErrorErrorException.cs +++ b/Bandwidth.Standard/WebRtc/Exceptions/ErrorException.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -21,14 +20,14 @@ namespace Bandwidth.Standard.WebRtc.Exceptions { - public class ErrorErrorException : ApiException + public class ErrorException : ApiException { /// /// Initialization constructor /// /// The reason for throwing exception /// The HTTP context that encapsulates request and response objects - public ErrorErrorException(string reason, HttpContext context) + public ErrorException(string reason, HttpContext context) : base(reason, context) { } /// diff --git a/Bandwidth.Standard/WebRtc/Models/AccountsParticipantsResponse.cs b/Bandwidth.Standard/WebRtc/Models/AccountsParticipantsResponse.cs index fe728b07..abd593ec 100644 --- a/Bandwidth.Standard/WebRtc/Models/AccountsParticipantsResponse.cs +++ b/Bandwidth.Standard/WebRtc/Models/AccountsParticipantsResponse.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -42,54 +41,5 @@ public AccountsParticipantsResponse(Models.Participant participant = null, [JsonProperty("token", NullValueHandling = NullValueHandling.Ignore)] public string Token { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"AccountsParticipantsResponse : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Participant = {(Participant == null ? "null" : Participant.ToString())}"); - toStringOutput.Add($"Token = {(Token == null ? "null" : Token == string.Empty ? "" : Token)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is AccountsParticipantsResponse other && - ((Participant == null && other.Participant == null) || (Participant?.Equals(other.Participant) == true)) && - ((Token == null && other.Token == null) || (Token?.Equals(other.Token) == true)); - } - - public override int GetHashCode() - { - int hashCode = -815453959; - - if (Participant != null) - { - hashCode += Participant.GetHashCode(); - } - - if (Token != null) - { - hashCode += Token.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/WebRtc/Models/Error.cs b/Bandwidth.Standard/WebRtc/Models/Error.cs deleted file mode 100644 index c5d95087..00000000 --- a/Bandwidth.Standard/WebRtc/Models/Error.cs +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.WebRtc.Models -{ - public class Error - { - public Error() { } - - public Error(int code, - string message) - { - Code = code; - Message = message; - } - - /// - /// Getter for code - /// - [JsonProperty("code")] - public int Code { get; set; } - - /// - /// Getter for message - /// - [JsonProperty("message")] - public string Message { get; set; } - - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"Error : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Code = {Code}"); - toStringOutput.Add($"Message = {(Message == null ? "null" : Message == string.Empty ? "" : Message)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is Error other && - Code.Equals(other.Code) && - ((Message == null && other.Message == null) || (Message?.Equals(other.Message) == true)); - } - - public override int GetHashCode() - { - int hashCode = -760548828; - hashCode += Code.GetHashCode(); - - if (Message != null) - { - hashCode += Message.GetHashCode(); - } - - return hashCode; - } - - } -} \ No newline at end of file diff --git a/Bandwidth.Standard/WebRtc/Models/Participant.cs b/Bandwidth.Standard/WebRtc/Models/Participant.cs index 1129d783..6e809d50 100644 --- a/Bandwidth.Standard/WebRtc/Models/Participant.cs +++ b/Bandwidth.Standard/WebRtc/Models/Participant.cs @@ -75,96 +75,5 @@ public Participant(string id = null, /// [JsonProperty("tag", NullValueHandling = NullValueHandling.Ignore)] public string Tag { get; set; } - - /// - /// Optional field to define the device api version of this participant - /// - [JsonProperty("deviceApiVersion", ItemConverterType = typeof(StringValuedEnumConverter), NullValueHandling = NullValueHandling.Ignore)] - public Models.DeviceApiVersionEnum? DeviceApiVersion { get; set; } - - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"Participant : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}"); - toStringOutput.Add($"CallbackUrl = {(CallbackUrl == null ? "null" : CallbackUrl == string.Empty ? "" : CallbackUrl)}"); - toStringOutput.Add($"PublishPermissions = {(PublishPermissions == null ? "null" : $"[{ string.Join(", ", PublishPermissions)} ]")}"); - toStringOutput.Add($"Sessions = {(Sessions == null ? "null" : $"[{ string.Join(", ", Sessions)} ]")}"); - toStringOutput.Add($"Subscriptions = {(Subscriptions == null ? "null" : Subscriptions.ToString())}"); - toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); - toStringOutput.Add($"DeviceApiVersion = {(DeviceApiVersion == null ? "null" : DeviceApiVersion.ToString())}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is Participant other && - ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) && - ((CallbackUrl == null && other.CallbackUrl == null) || (CallbackUrl?.Equals(other.CallbackUrl) == true)) && - ((PublishPermissions == null && other.PublishPermissions == null) || (PublishPermissions?.Equals(other.PublishPermissions) == true)) && - ((Sessions == null && other.Sessions == null) || (Sessions?.Equals(other.Sessions) == true)) && - ((Subscriptions == null && other.Subscriptions == null) || (Subscriptions?.Equals(other.Subscriptions) == true)) && - ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)) && - ((DeviceApiVersion == null && other.DeviceApiVersion == null) || (DeviceApiVersion?.Equals(other.DeviceApiVersion) == true)); - } - - public override int GetHashCode() - { - int hashCode = -1308942381; - - if (Id != null) - { - hashCode += Id.GetHashCode(); - } - - if (CallbackUrl != null) - { - hashCode += CallbackUrl.GetHashCode(); - } - - if (PublishPermissions != null) - { - hashCode += PublishPermissions.GetHashCode(); - } - - if (Sessions != null) - { - hashCode += Sessions.GetHashCode(); - } - - if (Subscriptions != null) - { - hashCode += Subscriptions.GetHashCode(); - } - - if (Tag != null) - { - hashCode += Tag.GetHashCode(); - } - - if (DeviceApiVersion != null) - { - hashCode += DeviceApiVersion.GetHashCode(); - } - - return hashCode; - } - } -} \ No newline at end of file +} diff --git a/Bandwidth.Standard/WebRtc/Models/ParticipantSubscription.cs b/Bandwidth.Standard/WebRtc/Models/ParticipantSubscription.cs index ee7c72c9..b96651f2 100644 --- a/Bandwidth.Standard/WebRtc/Models/ParticipantSubscription.cs +++ b/Bandwidth.Standard/WebRtc/Models/ParticipantSubscription.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -33,47 +32,5 @@ public ParticipantSubscription(string participantId) [JsonProperty("participantId")] public string ParticipantId { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"ParticipantSubscription : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"ParticipantId = {(ParticipantId == null ? "null" : ParticipantId == string.Empty ? "" : ParticipantId)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is ParticipantSubscription other && - ((ParticipantId == null && other.ParticipantId == null) || (ParticipantId?.Equals(other.ParticipantId) == true)); - } - - public override int GetHashCode() - { - int hashCode = 1364424941; - - if (ParticipantId != null) - { - hashCode += ParticipantId.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/WebRtc/Models/Session.cs b/Bandwidth.Standard/WebRtc/Models/Session.cs index 2e921ea0..97a99a14 100644 --- a/Bandwidth.Standard/WebRtc/Models/Session.cs +++ b/Bandwidth.Standard/WebRtc/Models/Session.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -41,54 +40,5 @@ public Session(string id = null, [JsonProperty("tag", NullValueHandling = NullValueHandling.Ignore)] public string Tag { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"Session : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}"); - toStringOutput.Add($"Tag = {(Tag == null ? "null" : Tag == string.Empty ? "" : Tag)}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is Session other && - ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) && - ((Tag == null && other.Tag == null) || (Tag?.Equals(other.Tag) == true)); - } - - public override int GetHashCode() - { - int hashCode = -256734511; - - if (Id != null) - { - hashCode += Id.GetHashCode(); - } - - if (Tag != null) - { - hashCode += Tag.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Standard/WebRtc/Models/Subscriptions.cs b/Bandwidth.Standard/WebRtc/Models/Subscriptions.cs index 5e10fd8e..a2ad2b67 100644 --- a/Bandwidth.Standard/WebRtc/Models/Subscriptions.cs +++ b/Bandwidth.Standard/WebRtc/Models/Subscriptions.cs @@ -3,7 +3,6 @@ * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ - using System; using System.IO; using System.Collections.Generic; @@ -42,54 +41,5 @@ public Subscriptions(string sessionId, [JsonProperty("participants", NullValueHandling = NullValueHandling.Ignore)] public List Participants { get; set; } - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"Subscriptions : ({string.Join(", ", toStringOutput)})"; - } - - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"SessionId = {(SessionId == null ? "null" : SessionId == string.Empty ? "" : SessionId)}"); - toStringOutput.Add($"Participants = {(Participants == null ? "null" : $"[{ string.Join(", ", Participants)} ]")}"); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - - return obj is Subscriptions other && - ((SessionId == null && other.SessionId == null) || (SessionId?.Equals(other.SessionId) == true)) && - ((Participants == null && other.Participants == null) || (Participants?.Equals(other.Participants) == true)); - } - - public override int GetHashCode() - { - int hashCode = -1970062954; - - if (SessionId != null) - { - hashCode += SessionId.GetHashCode(); - } - - if (Participants != null) - { - hashCode += Participants.GetHashCode(); - } - - return hashCode; - } - } } \ No newline at end of file diff --git a/Bandwidth.Tests/Messaging/APIControllerTest.cs b/Bandwidth.Tests/Messaging/APIControllerTest.cs index 60ad7c40..dc86abcf 100644 --- a/Bandwidth.Tests/Messaging/APIControllerTest.cs +++ b/Bandwidth.Tests/Messaging/APIControllerTest.cs @@ -44,7 +44,7 @@ public void SetUpDerived() public async Task TestTestListMedia() { // Parameters for the API call - string accountId = "900000"; + string userId = "900000"; string continuationToken = "12345"; // Perform API call @@ -52,7 +52,7 @@ public async Task TestTestListMedia() try { - result = await controller.ListMediaAsync(accountId, continuationToken); + result = await controller.ListMediaAsync(userId, continuationToken); } catch(ApiException) {} @@ -77,7 +77,7 @@ public async Task TestTestListMedia() public async Task TestTestGetMedia() { // Parameters for the API call - string accountId = "900000"; + string userId = "900000"; string mediaId = "0a610655-ba58"; // Perform API call @@ -85,7 +85,7 @@ public async Task TestTestGetMedia() try { - result = await controller.GetMediaAsync(accountId, mediaId); + result = await controller.GetMediaAsync(userId, mediaId); } catch(ApiException) {} @@ -110,14 +110,14 @@ public async Task TestTestGetMedia() public async Task TestTestDeleteMedia() { // Parameters for the API call - string accountId = "900000"; + string userId = "900000"; string mediaId = "tjdla-4562ld"; // Perform API call try { - await controller.DeleteMediaAsync(accountId, mediaId); + await controller.DeleteMediaAsync(userId, mediaId); } catch(ApiException) {} @@ -134,7 +134,7 @@ public async Task TestTestDeleteMedia() public async Task TestTestGetMessages() { // Parameters for the API call - string accountId = "900000"; + string userId = "900000"; string messageId = "9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6"; string sourceTn = "%2B15554443333"; string destinationTn = "%2B15554443333"; @@ -150,7 +150,7 @@ public async Task TestTestGetMessages() try { - result = await controller.GetMessagesAsync(accountId, messageId, sourceTn, destinationTn, messageStatus, errorCode, fromDateTime, toDateTime, pageToken, limit); + result = await controller.GetMessagesAsync(userId, messageId, sourceTn, destinationTn, messageStatus, errorCode, fromDateTime, toDateTime, pageToken, limit); } catch(ApiException) {} From 871e9120ed2797cb48377dee8831915434f1d101 Mon Sep 17 00:00:00 2001 From: jmulford-bandwidth Date: Tue, 9 Mar 2021 15:05:41 -0500 Subject: [PATCH 3/4] removed extra file --- .../ApiErrorResponseErrorException.cs | 53 ------------------- 1 file changed, 53 deletions(-) delete mode 100644 Bandwidth.Standard/Voice/Exceptions/ApiErrorResponseErrorException.cs diff --git a/Bandwidth.Standard/Voice/Exceptions/ApiErrorResponseErrorException.cs b/Bandwidth.Standard/Voice/Exceptions/ApiErrorResponseErrorException.cs deleted file mode 100644 index 92d28ae2..00000000 --- a/Bandwidth.Standard/Voice/Exceptions/ApiErrorResponseErrorException.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Bandwidth.Standard - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Bandwidth.Standard.Http.Client; -using Bandwidth.Standard.Exceptions; -using Bandwidth.Standard.Voice.Models; -using Bandwidth.Standard; -using Bandwidth.Standard.Utilities; - -namespace Bandwidth.Standard.Voice.Exceptions -{ - public class ApiErrorResponseErrorException : ApiException - { - /// - /// Initialization constructor - /// - /// The reason for throwing exception - /// The HTTP context that encapsulates request and response objects - public ApiErrorResponseErrorException(string reason, HttpContext context) - : base(reason, context) { } - - /// - /// Getter for type - /// - [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)] - public string Type { get; set; } - - /// - /// Getter for description - /// - [JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)] - public string Description { get; set; } - - /// - /// Getter for id - /// - [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] - public string Id { get; set; } - - } -} \ No newline at end of file From 752400d16d4b484e79b3999b1095974cc720bfc9 Mon Sep 17 00:00:00 2001 From: Jacob Mulford <39915377+jmulford-bw@users.noreply.github.com> Date: Tue, 23 Mar 2021 13:54:28 -0400 Subject: [PATCH 4/4] Update Participant.cs --- Bandwidth.Standard/WebRtc/Models/Participant.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Bandwidth.Standard/WebRtc/Models/Participant.cs b/Bandwidth.Standard/WebRtc/Models/Participant.cs index 6e809d50..3aa2a0dd 100644 --- a/Bandwidth.Standard/WebRtc/Models/Participant.cs +++ b/Bandwidth.Standard/WebRtc/Models/Participant.cs @@ -75,5 +75,11 @@ public Participant(string id = null, /// [JsonProperty("tag", NullValueHandling = NullValueHandling.Ignore)] public string Tag { get; set; } + + /// + /// Optional field to define the device api version of this participant + /// + [JsonProperty("deviceApiVersion", ItemConverterType = typeof(StringValuedEnumConverter), NullValueHandling = NullValueHandling.Ignore)] + public Models.DeviceApiVersionEnum? DeviceApiVersion { get; set; } } }