From 966a008a6ea3cf56d3a628210714f2868998da3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Vukadinovi=C4=87?= Date: Fri, 28 Nov 2025 18:03:07 +0100 Subject: [PATCH 1/9] Fixed issue when parsing enums in query parameters. --- ApiClient.Tests/Api/ApiTest.cs | 3 +++ ApiClient.Tests/Api/CallsApiTest.cs | 18 ++++++++--------- ApiClient.Tests/Api/EmailApiTest.cs | 10 +++++----- ApiClient.Tests/Api/SmsApiTest.cs | 4 ++-- src/Infobip.Api.Client/Client/ClientUtils.cs | 21 ++++++++++++++++++++ 5 files changed, 40 insertions(+), 16 deletions(-) diff --git a/ApiClient.Tests/Api/ApiTest.cs b/ApiClient.Tests/Api/ApiTest.cs index 30d1745..f21e92e 100644 --- a/ApiClient.Tests/Api/ApiTest.cs +++ b/ApiClient.Tests/Api/ApiTest.cs @@ -1,3 +1,4 @@ +using System.Globalization; using System.Reflection; using System.Runtime.Serialization; using Infobip.Api.Client; @@ -29,6 +30,8 @@ public class ApiTest [TestInitialize] public void StartMockServer() { + CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture; + wireMockServer = WireMockServer.Start(); configuration = new Configuration diff --git a/ApiClient.Tests/Api/CallsApiTest.cs b/ApiClient.Tests/Api/CallsApiTest.cs index 418450b..aaeea79 100644 --- a/ApiClient.Tests/Api/CallsApiTest.cs +++ b/ApiClient.Tests/Api/CallsApiTest.cs @@ -6430,7 +6430,7 @@ public void ShouldGetCallRecordings() var givenLocation = CallsRecordingLocation.Frankfurt; var givenQueryParameters = new Dictionary { - { "location", givenLocation.ToString() } + { "location", GetEnumAttributeValue(givenLocation) } }; var givenResponse = @" @@ -6505,7 +6505,7 @@ public void ShouldDeleteCallRecordings() var givenLocation = CallsRecordingLocation.Frankfurt; var givenQueryParameters = new Dictionary { - { "location", givenLocation.ToString() } + { "location", GetEnumAttributeValue(givenLocation) } }; var givenResponse = @" @@ -6814,7 +6814,7 @@ public void ShouldGetConferenceRecordings() var givenLocation = CallsRecordingLocation.Frankfurt; var givenQueryParameters = new Dictionary { - { "location", givenLocation.ToString() } + { "location", GetEnumAttributeValue(givenLocation) } }; var givenResponse = @" @@ -7000,7 +7000,7 @@ public void ShouldDeleteConferenceRecording() var givenLocation = CallsRecordingLocation.Frankfurt; var givenQueryParameters = new Dictionary { - { "location", givenLocation.ToString() } + { "location", GetEnumAttributeValue(givenLocation) } }; var givenResponse = @" @@ -7186,7 +7186,7 @@ public void ShouldComposeConferenceRecordingOnCalls() var givenLocation = CallsRecordingLocation.Frankfurt; var givenQueryParameters = new Dictionary { - { "location", givenLocation.ToString() } + { "location", GetEnumAttributeValue(givenLocation) } }; var givenRequest = @" @@ -7457,7 +7457,7 @@ public void ShouldGetDialogRecordings() var givenLocation = CallsRecordingLocation.Frankfurt; var givenQueryParameters = new Dictionary { - { "location", givenLocation.ToString() } + { "location", GetEnumAttributeValue(givenLocation) } }; var givenResponse = @" @@ -7639,7 +7639,7 @@ public void ShouldDeleteDialogRecordings() var givenLocation = CallsRecordingLocation.Frankfurt; var givenQueryParameters = new Dictionary { - { "location", givenLocation.ToString() } + { "location", GetEnumAttributeValue(givenLocation) } }; var givenResponse = @" @@ -7821,7 +7821,7 @@ public void ShouldComposeDialogRecordingOnCalls() var givenLocation = CallsRecordingLocation.Frankfurt; var givenQueryParameters = new Dictionary { - { "location", givenLocation.ToString() } + { "location", GetEnumAttributeValue(givenLocation) } }; var givenRequest = @" @@ -7865,7 +7865,7 @@ public void ShouldDeleteRecordingFile() var givenLocation = CallsRecordingLocation.Frankfurt; var givenQueryParameters = new Dictionary { - { "location", givenLocation.ToString() } + { "location", GetEnumAttributeValue(givenLocation) } }; var givenResponse = @" diff --git a/ApiClient.Tests/Api/EmailApiTest.cs b/ApiClient.Tests/Api/EmailApiTest.cs index 9b249da..2cf2440 100644 --- a/ApiClient.Tests/Api/EmailApiTest.cs +++ b/ApiClient.Tests/Api/EmailApiTest.cs @@ -1107,7 +1107,7 @@ public void ShouldGetSuppresions() var givenQueryParameters = new Dictionary { { "domainName", expectedEmailAddress }, - { "type", givenType.ToString() }, + { "type", GetEnumAttributeValue(EmailSuppressionType.Bounce) }, { "page", givenPage.ToString() }, { "size", givenSize.ToString() } }; @@ -1134,16 +1134,16 @@ void AssertEmailSuppressionInfoPageResponse(EmailSuppressionInfoPageResponse ema Assert.AreEqual(expectedSize, emailSuppressionInfoPageResponse.Paging.Size); } - AssertResponse(emailApi.GetSuppressions(givenDomainName, givenType), + AssertResponse(emailApi.GetSuppressions(domainName: givenDomainName, type: givenType, page: givenPage, size:givenSize), AssertEmailSuppressionInfoPageResponse); - AssertResponse(emailApi.GetSuppressionsAsync(givenDomainName, givenType).Result, + AssertResponse(emailApi.GetSuppressionsAsync(domainName: givenDomainName, type: givenType, page: givenPage, size:givenSize).Result, AssertEmailSuppressionInfoPageResponse); AssertResponseWithHttpInfo( - emailApi.GetSuppressionsWithHttpInfo(givenDomainName, givenType), + emailApi.GetSuppressionsWithHttpInfo(domainName: givenDomainName, type: givenType, page: givenPage, size:givenSize), AssertEmailSuppressionInfoPageResponse, 200); AssertResponseWithHttpInfo( - emailApi.GetSuppressionsWithHttpInfoAsync(givenDomainName, givenType).Result, + emailApi.GetSuppressionsWithHttpInfoAsync(domainName: givenDomainName, type: givenType, page: givenPage, size:givenSize).Result, AssertEmailSuppressionInfoPageResponse, 200); } diff --git a/ApiClient.Tests/Api/SmsApiTest.cs b/ApiClient.Tests/Api/SmsApiTest.cs index 07d4ae9..c26a0e0 100644 --- a/ApiClient.Tests/Api/SmsApiTest.cs +++ b/ApiClient.Tests/Api/SmsApiTest.cs @@ -1027,10 +1027,10 @@ public void ShouldGetOutboundLogs() }}"; SetUpGetRequest(SMS_LOGS_ENDPOINT, 200, expectedResponse, - new Dictionary { { "bulkId", bulkId } }); + new Dictionary { { "bulkId", bulkId }, {"generalStatus", GetEnumAttributeValue(MessageGeneralStatus.Accepted)}}); var smsApiClient = new SmsApi(configuration); - var actualResponse = smsApiClient.GetOutboundSmsMessageLogs(bulkId: new List { bulkId }); + var actualResponse = smsApiClient.GetOutboundSmsMessageLogs(bulkId: new List {bulkId}, generalStatus: MessageGeneralStatus.Accepted); var expectedDeserializedLogs = new SmsLogsResponse(new List { diff --git a/src/Infobip.Api.Client/Client/ClientUtils.cs b/src/Infobip.Api.Client/Client/ClientUtils.cs index 41cfe46..25bc2c0 100644 --- a/src/Infobip.Api.Client/Client/ClientUtils.cs +++ b/src/Infobip.Api.Client/Client/ClientUtils.cs @@ -14,6 +14,8 @@ using System.Globalization; using System.IO; using System.Linq; +using System.Reflection; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; @@ -117,10 +119,29 @@ public static string ParameterToString(object obj) return boolean ? "true" : "false"; if (obj is ICollection collection) return string.Join(",", collection.Cast()); + if (obj is Enum) + return EnumToString(obj); return Convert.ToString(obj, CultureInfo.InvariantCulture); } + /// + /// Returns the string value of an enum, preferring [EnumMember(Value=...)] if present, otherwise ToString(). + /// + /// The enum value to be transformed into string. + /// A string representation of the enum value. + public static string EnumToString(object enumValue) + { + var type = enumValue.GetType(); + var enumType = Nullable.GetUnderlyingType(type) ?? type; + if (!enumType.IsEnum) + return Convert.ToString(enumValue, CultureInfo.InvariantCulture); + var name = Convert.ToString(enumValue, CultureInfo.InvariantCulture); + var member = enumType.GetMember(name).FirstOrDefault(); + var attr = member?.GetCustomAttribute(); + return attr?.Value ?? name.ToUpperInvariant(); + } + /// /// Convert stream to byte array /// From 6471ad30087643a298471919ac0855eb3545b239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Vukadinovi=C4=87?= Date: Fri, 28 Nov 2025 18:16:11 +0100 Subject: [PATCH 2/9] Update configuration, README & CHANGELOG. --- CHANGELOG.md | 6 ++++++ README.md | 6 +++--- src/Infobip.Api.Client/Client/Configuration.cs | 4 ++-- src/Infobip.Api.Client/Infobip.Api.Client.csproj | 6 +++--- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 735949c..6e26b70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to the library will be documented in this file. The format of the file is based on [Keep a Changelog](http://keepachangelog.com/) and this library adheres to [Semantic Versioning](http://semver.org/) as mentioned in [README.md][readme] file. +## [ [4.0.1](https://github.com/infobip/infobip-api-csharp-client/releases/tag/v4.0.1) ] - 2025-12-01 + +### Fixed +- Error parsing Enums for the query parameter (https://github.com/infobip/infobip-api-csharp-client/issues/49) +- Tests are now culture-invariant: their results should no longer depend on the system's locale/culture settings. + ## [ [4.0.0](https://github.com/infobip/infobip-api-csharp-client/releases/tag/v4.0.0) ] - 2025-02-28 🎉 **NEW Major Version of `Infobip.Api.Client`.** diff --git a/README.md b/README.md index a9d9370..111fd6e 100644 --- a/README.md +++ b/README.md @@ -37,17 +37,17 @@ Within Visual Studio, use the Package Manager UI to browse for `Infobip.Api.Clie #### Package Manager Console Alternatively, also within Visual Studio, use the Package Manager Console command: - Install-Package Infobip.Api.Client -Version 4.0.0 + Install-Package Infobip.Api.Client -Version 4.0.1 #### .NET CLI If you are used to .NET CLI, the following command is going to be sufficient for you: - dotnet add package Infobip.Api.Client --version 4.0.0 + dotnet add package Infobip.Api.Client --version 4.0.1 ### Package reference Including the package directly into project file is also valid option. - + ## Quickstart diff --git a/src/Infobip.Api.Client/Client/Configuration.cs b/src/Infobip.Api.Client/Client/Configuration.cs index 7983cda..0e1d424 100644 --- a/src/Infobip.Api.Client/Client/Configuration.cs +++ b/src/Infobip.Api.Client/Client/Configuration.cs @@ -41,7 +41,7 @@ public class Configuration : IReadableConfiguration /// Version of the package. /// /// Version of the package. - public const string Version = "4.0.0"; + public const string Version = "4.0.1"; private string _dateTimeFormat = Iso8601DateTimeFormat; @@ -54,7 +54,7 @@ public class Configuration : IReadableConfiguration public Configuration() { Proxy = null; - UserAgent = "infobip-api-client-csharp/4.0.0"; + UserAgent = "infobip-api-client-csharp/4.0.1"; BasePath = "http://localhost"; DefaultHeaders = new ConcurrentDictionary(); diff --git a/src/Infobip.Api.Client/Infobip.Api.Client.csproj b/src/Infobip.Api.Client/Infobip.Api.Client.csproj index f3e00ae..8132903 100644 --- a/src/Infobip.Api.Client/Infobip.Api.Client.csproj +++ b/src/Infobip.Api.Client/Infobip.Api.Client.csproj @@ -12,9 +12,9 @@ C# library for consuming Infobip's API Copyright @ Infobip ltd. All rights reserved. Infobip.Api.Client - 4.0.0 - 4.0.0 - 4.0.0 + 4.0.1 + 4.0.1 + 4.0.1 bin\$(Configuration)\$(TargetFramework)\Infobip.Api.Client.xml MIT https://github.com/infobip/infobip-api-csharp-client.git From 8aae20389256ec76a4611667c117d82ade309776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Vukadinovi=C4=87?= Date: Mon, 1 Dec 2025 17:00:08 +0100 Subject: [PATCH 3/9] Added test for ParameterToString method. --- ApiClient.Tests/ClientUtilsTest.cs | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 ApiClient.Tests/ClientUtilsTest.cs diff --git a/ApiClient.Tests/ClientUtilsTest.cs b/ApiClient.Tests/ClientUtilsTest.cs new file mode 100644 index 0000000..809e66b --- /dev/null +++ b/ApiClient.Tests/ClientUtilsTest.cs @@ -0,0 +1,37 @@ +using System.Runtime.Serialization; +using Infobip.Api.Client; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace ApiClient.Tests; + +[TestClass] +public class ClientUtilsTest +{ + + private enum TestEnum + { + [EnumMember(Value = "OK")] Ok = 1, + + [EnumMember(Value = "ALSO_OK")] AlsoOk = 2, + } + + [TestMethod] + public void ParameterToStringTest() + { + var dateTime = new DateTime(2025, 12, 1, 15, 30, 45); + var dateTimeOffset = new DateTimeOffset(dateTime); + var booleanValue = true; + var list = new List { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; + var enumValue = TestEnum.AlsoOk; + var randomNumber = 5; + var randomString = "axT3!er_hOp7&"; + + Assert.AreEqual(ClientUtils.ParameterToString(dateTime), "2025-12-01T15:30:45.000+01:00"); + Assert.AreEqual(ClientUtils.ParameterToString(dateTimeOffset), "2025-12-01T15:30:45.000+01:00"); + Assert.AreEqual(ClientUtils.ParameterToString(booleanValue), "true"); + Assert.AreEqual(ClientUtils.ParameterToString(list), "1,2,3,4,5,6,7,8,9,10,11,12"); + Assert.AreEqual(ClientUtils.ParameterToString(enumValue), "ALSO_OK"); + Assert.AreEqual(ClientUtils.ParameterToString(randomNumber), "5"); + Assert.AreEqual(ClientUtils.ParameterToString(randomString), "axT3!er_hOp7&"); + } +} \ No newline at end of file From 75351ad6ab08acc8d36a165dcfd4b1d9d80d96e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Vukadinovi=C4=87?= Date: Tue, 2 Dec 2025 17:23:54 +0100 Subject: [PATCH 4/9] Fixed tests, updated CHANGELOG & bumped certain test dependencies. --- ApiClient.Tests/ApiClient.Tests.csproj | 6 +++--- ApiClient.Tests/ClientUtilsTest.cs | 6 +++--- CHANGELOG.md | 12 ++++++++++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ApiClient.Tests/ApiClient.Tests.csproj b/ApiClient.Tests/ApiClient.Tests.csproj index 9963e2a..49947f0 100644 --- a/ApiClient.Tests/ApiClient.Tests.csproj +++ b/ApiClient.Tests/ApiClient.Tests.csproj @@ -11,9 +11,9 @@ - - - + + + diff --git a/ApiClient.Tests/ClientUtilsTest.cs b/ApiClient.Tests/ClientUtilsTest.cs index 809e66b..601efa5 100644 --- a/ApiClient.Tests/ClientUtilsTest.cs +++ b/ApiClient.Tests/ClientUtilsTest.cs @@ -18,7 +18,7 @@ private enum TestEnum [TestMethod] public void ParameterToStringTest() { - var dateTime = new DateTime(2025, 12, 1, 15, 30, 45); + var dateTime = new DateTime(2025, 12, 1, 15, 30, 45, DateTimeKind.Utc); var dateTimeOffset = new DateTimeOffset(dateTime); var booleanValue = true; var list = new List { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; @@ -26,8 +26,8 @@ public void ParameterToStringTest() var randomNumber = 5; var randomString = "axT3!er_hOp7&"; - Assert.AreEqual(ClientUtils.ParameterToString(dateTime), "2025-12-01T15:30:45.000+01:00"); - Assert.AreEqual(ClientUtils.ParameterToString(dateTimeOffset), "2025-12-01T15:30:45.000+01:00"); + Assert.AreEqual(ClientUtils.ParameterToString(dateTime), "2025-12-01T15:30:45.000+00:00"); + Assert.AreEqual(ClientUtils.ParameterToString(dateTimeOffset), "2025-12-01T15:30:45.000+00:00"); Assert.AreEqual(ClientUtils.ParameterToString(booleanValue), "true"); Assert.AreEqual(ClientUtils.ParameterToString(list), "1,2,3,4,5,6,7,8,9,10,11,12"); Assert.AreEqual(ClientUtils.ParameterToString(enumValue), "ALSO_OK"); diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e26b70..4f69cf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,18 @@ and this library adheres to [Semantic Versioning](http://semver.org/) as mention ## [ [4.0.1](https://github.com/infobip/infobip-api-csharp-client/releases/tag/v4.0.1) ] - 2025-12-01 +### Changed +Due to vulnerabilities detected in System.Net.Http package ( + [#1](https://security.snyk.io/vuln/SNYK-DOTNET-SYSTEMNETHTTP-60045), + [#2](https://security.snyk.io/vuln/SNYK-DOTNET-SYSTEMNETHTTP-60046), + [#3](https://security.snyk.io/vuln/SNYK-DOTNET-SYSTEMNETHTTP-60047), + [#4](https://security.snyk.io/vuln/SNYK-DOTNET-SYSTEMNETHTTP-72439) + & [#5](https://security.snyk.io/vuln/SNYK-DOTNET-SYSTEMTEXTREGULAREXPRESSIONS-174708)), + bumped following test packages: +- `MSTest.TestAdapter` & `MSTest.TestFramework` from version `2.1.1` to version `3.11.1` +- `WireMock.Net to version` from version `1.4.20` to version `1.8.1` + + ### Fixed - Error parsing Enums for the query parameter (https://github.com/infobip/infobip-api-csharp-client/issues/49) - Tests are now culture-invariant: their results should no longer depend on the system's locale/culture settings. From 82f074c2cdef7198f4c9908e8fa8d66561f7936d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Vukadinovi=C4=87?= <138505157+lvukadinovic-ib@users.noreply.github.com> Date: Tue, 2 Dec 2025 17:26:12 +0100 Subject: [PATCH 5/9] Updated snyk.yml --- .github/workflows/snyk.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/snyk.yml b/.github/workflows/snyk.yml index b1deb4c..f81027b 100644 --- a/.github/workflows/snyk.yml +++ b/.github/workflows/snyk.yml @@ -14,7 +14,6 @@ jobs: run: dotnet restore - name: Run Snyk to check for vulnerabilities uses: snyk/actions/dotnet@master - continue-on-error: true # To make sure that SARIF upload gets called env: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} with: @@ -22,7 +21,3 @@ jobs: --all-projects --sarif-file-output=snyk.sarif --severity-threshold=high - - name: Upload result to GitHub Code Scanning - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: snyk.sarif From 93e33b16bca959a127df654e96a700406d58cd3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Vukadinovi=C4=87?= Date: Tue, 2 Dec 2025 17:32:10 +0100 Subject: [PATCH 6/9] Refactored tests a bit. --- ApiClient.Tests/Api/ApiTest.cs | 5 ++--- ApiClient.Tests/Api/EmailApiTest.cs | 5 ++--- ApiClient.Tests/ApiExceptionTest.cs | 3 +-- ApiClient.Tests/DateTimeSerializationTest.cs | 7 +++---- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/ApiClient.Tests/Api/ApiTest.cs b/ApiClient.Tests/Api/ApiTest.cs index f21e92e..79a8acf 100644 --- a/ApiClient.Tests/Api/ApiTest.cs +++ b/ApiClient.Tests/Api/ApiTest.cs @@ -2,7 +2,6 @@ using System.Reflection; using System.Runtime.Serialization; using Infobip.Api.Client; -using Microsoft.VisualStudio.TestTools.UnitTesting; using WireMock.Matchers; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; @@ -200,9 +199,9 @@ protected void SetUpMultipartFormRequest(string url, Multimap gi req.WithBody(body => { var allKeysFound = givenParts.All(kvp => - body.Contains($"name={kvp.Key}", StringComparison.InvariantCultureIgnoreCase)); + body!.Contains($"name={kvp.Key}", StringComparison.InvariantCultureIgnoreCase)); var allValuesFound = givenParts.All(kvp => - kvp.Value.All(value => body.Contains(value, StringComparison.InvariantCultureIgnoreCase))); + kvp.Value.All(value => body!.Contains(value, StringComparison.InvariantCultureIgnoreCase))); return allValuesFound && allKeysFound; }); diff --git a/ApiClient.Tests/Api/EmailApiTest.cs b/ApiClient.Tests/Api/EmailApiTest.cs index 2cf2440..da55660 100644 --- a/ApiClient.Tests/Api/EmailApiTest.cs +++ b/ApiClient.Tests/Api/EmailApiTest.cs @@ -4,7 +4,6 @@ using Infobip.Api.Client.Api; using Infobip.Api.Client.Client; using Infobip.Api.Client.Model; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using static Infobip.Api.Client.Model.EmailAddDomainRequest; using JsonSerializer = System.Text.Json.JsonSerializer; @@ -1879,7 +1878,7 @@ public void ShouldUnassignIpPoolFromDomain() emailApi.RemoveIpPoolFromDomainWithHttpInfoAsync(givenDomainId, givenPoolId).Result, 204); } - [DataTestMethod] + [TestMethod] [DataRow(0)] [DataRow(1)] public void SendEmailErrorResponseTest(int errorResponseIndex) @@ -2136,7 +2135,7 @@ void AssertEmailWebhookTrackResponse(EmailWebhookTrackResponse emailWebhookTrack } } - [DataTestMethod] + [TestMethod] [DataRow(0)] [DataRow(1)] public void GetEmailDeliveryReportsResponseTest(int errorResponseIndex) diff --git a/ApiClient.Tests/ApiExceptionTest.cs b/ApiClient.Tests/ApiExceptionTest.cs index b54a749..ed1c061 100644 --- a/ApiClient.Tests/ApiExceptionTest.cs +++ b/ApiClient.Tests/ApiExceptionTest.cs @@ -1,7 +1,6 @@ using ApiClient.Tests.Api; using Infobip.Api.Client.Api; using Infobip.Api.Client.Model; -using Microsoft.VisualStudio.TestTools.UnitTesting; using ApiException = Infobip.Api.Client.ApiException; namespace ApiClient.Tests; @@ -23,7 +22,7 @@ public class ApiExceptionTest : ApiTest Tuple.Create(503, "0", "Service Unavailable", "Error processing email validation request! Please try again") }; - [DataTestMethod] + [TestMethod] [DataRow(0)] [DataRow(1)] [DataRow(2)] diff --git a/ApiClient.Tests/DateTimeSerializationTest.cs b/ApiClient.Tests/DateTimeSerializationTest.cs index 030d4b2..75cd405 100644 --- a/ApiClient.Tests/DateTimeSerializationTest.cs +++ b/ApiClient.Tests/DateTimeSerializationTest.cs @@ -1,5 +1,4 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Newtonsoft.Json; +using Newtonsoft.Json; namespace ApiClient.Tests; @@ -33,7 +32,7 @@ public class DateTimeSerializationTest [DataRow("2035-08-18T10:38:42.777-0130", 6)] [DataRow("2035-08-18T17:38:42.777+0530", 7)] [DataRow("2035-08-18T06:38:42.777-0530", 8)] - [DataTestMethod] + [TestMethod] public void DateTimeFormatDeserializationTest(string dateString, int dateValueIndex) { var expected = DateTimeValues[dateValueIndex]; @@ -60,7 +59,7 @@ public void DateTimeFormatDeserializationTest(string dateString, int dateValueIn [DataRow(6, "2035-08-18T10:38:42.777-01:30")] [DataRow(7, "2035-08-18T17:38:42.777+05:30")] [DataRow(8, "2035-08-18T06:38:42.777-05:30")] - [DataTestMethod] + [TestMethod] public void DateTimeFormatSerializationTest(int dateValueIndex, string expected) { var initialDate = DateTimeValues[dateValueIndex]; From 2e5f77380634653a199b0b4c422de5915665da3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Vukadinovi=C4=87?= <138505157+lvukadinovic-ib@users.noreply.github.com> Date: Wed, 3 Dec 2025 10:35:36 +0100 Subject: [PATCH 7/9] Updated release date in CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f69cf6..f008995 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to the library will be documented in this file. The format of the file is based on [Keep a Changelog](http://keepachangelog.com/) and this library adheres to [Semantic Versioning](http://semver.org/) as mentioned in [README.md][readme] file. -## [ [4.0.1](https://github.com/infobip/infobip-api-csharp-client/releases/tag/v4.0.1) ] - 2025-12-01 +## [ [4.0.1](https://github.com/infobip/infobip-api-csharp-client/releases/tag/v4.0.1) ] - 2025-12-03 ### Changed Due to vulnerabilities detected in System.Net.Http package ( From 7439a7a3045f9b0824d408e6c168a9eea1bc5164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Vukadinovi=C4=87?= Date: Fri, 5 Dec 2025 10:46:14 +0100 Subject: [PATCH 8/9] Refactored tests. --- ApiClient.Tests/Api/ApiTest.cs | 26 +- ApiClient.Tests/Api/CallRoutingApiTest.cs | 11 +- ApiClient.Tests/Api/CallsApiTest.cs | 212 +++++++++-------- ApiClient.Tests/Api/ClickToCallApiTest.cs | 3 +- ApiClient.Tests/Api/EmailApiTest.cs | 118 ++++------ ApiClient.Tests/Api/FlowApiTest.cs | 7 +- ApiClient.Tests/Api/FormsApiTest.cs | 9 +- ApiClient.Tests/Api/NumberMaskingApiTest.cs | 21 +- ApiClient.Tests/Api/SmsApiTest.cs | 29 +-- ApiClient.Tests/Api/TfaApiTest.cs | 45 ++-- ApiClient.Tests/Api/VoiceApiTest.cs | 248 ++++++++++---------- ApiClient.Tests/ApiExceptionTest.cs | 4 +- ApiClient.Tests/ClientUtilsTest.cs | 1 - ApiClient.Tests/GeneralSetupTest.cs | 5 +- 14 files changed, 348 insertions(+), 391 deletions(-) diff --git a/ApiClient.Tests/Api/ApiTest.cs b/ApiClient.Tests/Api/ApiTest.cs index 79a8acf..3aa0394 100644 --- a/ApiClient.Tests/Api/ApiTest.cs +++ b/ApiClient.Tests/Api/ApiTest.cs @@ -22,28 +22,28 @@ public class ApiTest protected const string SERVER_HEADER_VALUE_COMMA = "SMS,API"; protected const string X_REQUEST_ID_HEADER_VALUE = "1608758729810312842"; - protected Configuration? configuration; + protected Configuration? Configuration; - protected WireMockServer? wireMockServer; + protected WireMockServer? WireMockServer; [TestInitialize] public void StartMockServer() { CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture; - wireMockServer = WireMockServer.Start(); + WireMockServer = WireMockServer.Start(); - configuration = new Configuration + Configuration = new Configuration { ApiKey = API_KEY, - BasePath = "http://localhost:" + wireMockServer.Ports[0] + BasePath = "http://localhost:" + WireMockServer.Ports[0] }; } [TestCleanup] public void TearDown() { - wireMockServer!.Stop(); + WireMockServer!.Stop(); } protected void SetUpGetRequest(string url, int statusCode, string expectedResponse, @@ -57,7 +57,7 @@ protected void SetUpGetRequest(string url, int statusCode, string expectedRespon if (givenParameters != null && givenParameters.Count > 0) request = request.WithParam(EqualToParams(givenParameters)); - wireMockServer!.Given(request) + WireMockServer!.Given(request) .RespondWith(Response.Create() .WithStatusCode(statusCode) .WithHeader("Content-Type", CONTENT_TYPE_HEADER_VALUE) @@ -77,7 +77,7 @@ protected void SetUpGetRequestBinary(string url, int statusCode, string expected if (givenParameters != null && givenParameters.Count > 0) request = request.WithParam(EqualToParams(givenParameters)); - wireMockServer!.Given(request) + WireMockServer!.Given(request) .RespondWith(Response.Create() .WithStatusCode(statusCode) .WithHeader("Content-Type", CONTENT_TYPE_HEADER_VALUE) @@ -109,7 +109,7 @@ protected void SetUpPostRequest(string url, int statusCode, string? givenRequest response = response.WithHeader("Content-Type", CONTENT_TYPE_HEADER_VALUE) .WithBody(expectedResponse); - wireMockServer!.Given(request).RespondWith(response); + WireMockServer!.Given(request).RespondWith(response); } protected void SetUpPatchRequest(string url, int statusCode, string givenRequest, string? expectedResponse = null, @@ -134,7 +134,7 @@ protected void SetUpPatchRequest(string url, int statusCode, string givenRequest response = response.WithHeader("Content-Type", CONTENT_TYPE_HEADER_VALUE) .WithBody(expectedResponse); - wireMockServer!.Given(request).RespondWith(response); + WireMockServer!.Given(request).RespondWith(response); } protected void SetUpPutRequest(string url, int statusCode, string givenRequest, string? expectedResponse = null, @@ -159,7 +159,7 @@ protected void SetUpPutRequest(string url, int statusCode, string givenRequest, response = response.WithHeader("Content-Type", CONTENT_TYPE_HEADER_VALUE) .WithBody(expectedResponse); - wireMockServer!.Given(request).RespondWith(response); + WireMockServer!.Given(request).RespondWith(response); } protected void SetUpDeleteRequest(string url, int statusCode, string? givenRequest = null, @@ -184,7 +184,7 @@ protected void SetUpDeleteRequest(string url, int statusCode, string? givenReque response = response.WithHeader("Content-Type", CONTENT_TYPE_HEADER_VALUE) .WithBody(expectedResponse); - wireMockServer!.Given(request).RespondWith(response); + WireMockServer!.Given(request).RespondWith(response); } protected void SetUpMultipartFormRequest(string url, Multimap givenParts, string expectedResponse, @@ -212,7 +212,7 @@ protected void SetUpMultipartFormRequest(string url, Multimap gi .WithHeader("X-Request-Id", X_REQUEST_ID_HEADER_VALUE) .WithBody(expectedResponse); - wireMockServer!.Given(req).RespondWith(resp); + WireMockServer!.Given(req).RespondWith(resp); } private Func>, bool>[] EqualToParams(Dictionary parameters) diff --git a/ApiClient.Tests/Api/CallRoutingApiTest.cs b/ApiClient.Tests/Api/CallRoutingApiTest.cs index edac04c..04b2f21 100644 --- a/ApiClient.Tests/Api/CallRoutingApiTest.cs +++ b/ApiClient.Tests/Api/CallRoutingApiTest.cs @@ -1,6 +1,5 @@ using Infobip.Api.Client.Api; using Infobip.Api.Client.Model; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using JsonSerializer = System.Text.Json.JsonSerializer; @@ -115,7 +114,7 @@ public void ShouldGetCallRoutes() SetUpGetRequest(CALL_ROUTING_ROUTES, 200, expectedResponse, givenQueryParameters); - var callRoutingApi = new CallRoutingApi(configuration); + var callRoutingApi = new CallRoutingApi(Configuration); void AssertCallRoutingRouteResponsePage(CallRoutingRouteResponsePage callRoutingRouteResponsePage) { @@ -266,7 +265,7 @@ public void ShouldCreateCallRoute() SetUpPostRequest(CALL_ROUTING_ROUTES, 201, givenRequest, expectedResponse); - var callRoutingApi = new CallRoutingApi(configuration); + var callRoutingApi = new CallRoutingApi(Configuration); var callroutingRouteRequest = new CallRoutingRouteRequest( givenName, @@ -367,7 +366,7 @@ public void ShouldGetCallRoute() SetUpGetRequest(CALL_ROUTING_ROUTE.Replace("{routeId}", givenRouteId), 200, expectedResponse); - var callRoutingApi = new CallRoutingApi(configuration); + var callRoutingApi = new CallRoutingApi(Configuration); void AssertCallRoutingRouteResponsePage(CallRoutingRouteResponse callRoutingRouteResponse) { @@ -487,7 +486,7 @@ public void ShouldUpdateCallRoutes() SetUpPutRequest(CALL_ROUTING_ROUTE.Replace("{routeId}", givenRouteId), 200, givenRequest, expectedResponse); - var callRoutingApi = new CallRoutingApi(configuration); + var callRoutingApi = new CallRoutingApi(Configuration); var callroutingRouteRequest = new CallRoutingRouteRequest( givenName, @@ -591,7 +590,7 @@ public void ShouldDeleteCallRoutes() SetUpDeleteRequest(CALL_ROUTING_ROUTE.Replace("{routeId}", givenRouteId), 200, expectedResponse: exectedResponse, givenParameters: new Dictionary()); - var callRoutingApi = new CallRoutingApi(configuration); + var callRoutingApi = new CallRoutingApi(Configuration); void AssertCallRoutingRouteResponsePage(CallRoutingRouteResponse callRoutingRouteResponse) { diff --git a/ApiClient.Tests/Api/CallsApiTest.cs b/ApiClient.Tests/Api/CallsApiTest.cs index aaeea79..c76cf3f 100644 --- a/ApiClient.Tests/Api/CallsApiTest.cs +++ b/ApiClient.Tests/Api/CallsApiTest.cs @@ -3,7 +3,6 @@ using Infobip.Api.Client.Api; using Infobip.Api.Client.Client; using Infobip.Api.Client.Model; -using Microsoft.VisualStudio.TestTools.UnitTesting; namespace ApiClient.Tests.Api; @@ -223,7 +222,7 @@ public void ShouldGetCalls() SetUpGetRequest(GET_CALLS_ENDPOINT, 200, givenResponse, givenParameters); - var callsApi = new CallsApi(configuration); + var callsApi = new CallsApi(Configuration); var response = callsApi.GetCalls(givenType, givenCallsConfigurationId, givenApplicationId, givenFrom, givenTo, givenDirection, givenStatus, givenStartTimeAfter, givenConferenceId, givenDialogId, givenBulkId, givenPage, @@ -335,7 +334,7 @@ public void ShouldCreateCall() SetUpPostRequest(CREATE_CALL_ENDPOINT, 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallRequest( new CallsWebRtcEndpoint("Bob"), @@ -435,7 +434,7 @@ public void ShouldCreateCallWithoutSpecifyingFromField() SetUpPostRequest(CREATE_CALL_ENDPOINT, 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallRequest( new CallsWebRtcEndpoint("Bob"), @@ -518,7 +517,7 @@ public void ShouldGetCall() SetUpGetRequest(GET_CALL_ENDPOINT.Replace("{callId}", givenCallId), 200, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var response = api.GetCall(givenCallId); @@ -647,7 +646,7 @@ public void ShouldGetCallsHistory() SetUpGetRequest(GET_CALLS_HISTORY_ENDPOINT, 200, givenResponse, queryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var response = api.GetCallsHistory(givenType, givenCallsConfigurationId, givenApplicationId, givenFrom, givenTo, givenDirection, givenStatus, givenStartTimeAfter, givenEndTimeBefore, givenConferenceId, givenDialogId, @@ -756,7 +755,7 @@ public void ShouldGetCallHistory() SetUpGetRequest(GET_CALL_HISTORY_ENDPOINT.Replace("{callId}", givenCallId), 200, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var response = api.GetCallHistory(givenCallId); @@ -858,7 +857,7 @@ public void ShouldConnectCalls() } }"; - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsConnectRequest( new List @@ -1028,7 +1027,7 @@ public void ShouldConnectWithNewCall() SetUpPostRequest(CONNECT_WITH_NEW_CALL_ENDPOINT.Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsConnectWithNewCallRequest( new CallsActionCallRequest( @@ -1131,7 +1130,7 @@ public void ShouldCallsSendRinging() SetUpPostRequest(SEND_RINGING_ENDPOINT.Replace("{callId}", givenCallId), 200, null, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var response = api.SendRinging(givenCallId); @@ -1161,7 +1160,7 @@ public void ShouldCallsPreAnswerCall() SetUpPostRequest(PRE_ANSWER_CALL_ENDPOINT.Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsPreAnswerRequest( false, @@ -1209,7 +1208,7 @@ public void ShouldCallsAnswerCall() SetUpPostRequest(ANSWER_CALL_ENDPOINT.Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsAnswerRequest( new Dictionary @@ -1284,7 +1283,7 @@ public void ShouldCallsHangupCall() SetUpPostRequest(HANGUP_CALL_ENDPOINT.Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsHangupRequest { @@ -1352,7 +1351,7 @@ public void ShouldCallsPlayFile() SetUpPostRequest(CALL_PLAY_FILE_ENDPOINT.Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsPlayRequest( content: new CallsFilePlayContent( @@ -1394,7 +1393,7 @@ public void ShouldCallsPlayFileProvidedByUrl() SetUpPostRequest(CALL_PLAY_FILE_ENDPOINT.Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsPlayRequest( content: new CallsUrlPlayContent( @@ -1435,7 +1434,7 @@ public void ShouldCallsStopPlayingFile() SetUpPostRequest(CALL_STOP_PLAYING_FILE_ENDPOINT.Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsStopPlayRequest( new Dictionary @@ -1479,7 +1478,7 @@ public void ShouldCallsSayText() SetUpPostRequest(CALL_SAY_TEXT_ENDPOINT.Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsSayRequest( "This is an advanced example of text to speech", @@ -1520,7 +1519,7 @@ public void ShouldCallsSendDtmf() SetUpPostRequest(CALL_SEND_DTMF_ENDPOINT.Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsDtmfSendRequest(dtmf: "341#"); @@ -1551,7 +1550,7 @@ public void ShouldCallsCaptureDtmf() SetUpPostRequest(CALL_CAPTURE_DTMF_ENDPOINT.Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsDtmfCaptureRequest( 4, @@ -1593,7 +1592,7 @@ public void ShouldCallsCaptureSpeech() SetUpPostRequest(CALL_CAPTURE_SPEECH_ENDPOINT.Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsSpeechCaptureRequest( CallsLanguage.EnGb, @@ -1632,7 +1631,7 @@ public void ShouldCallsStartTranscription() SetUpPostRequest(CALL_START_TRANSCRIPTION_ENDPOINT.Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsStartTranscriptionRequest( new CallsTranscription( @@ -1661,7 +1660,7 @@ public void ShouldCallsStopTranscription() SetUpPostRequest(CALL_STOP_TRANSCRIPTION_ENDPOINT.Replace("{callId}", givenCallId), 200, null, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var response = api.CallStopTranscription(givenCallId); @@ -1698,7 +1697,7 @@ public void ShouldCallsStartRecording() SetUpPostRequest(CALL_START_RECORDING_ENDPOINT.Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsRecordingStartRequest( new CallsRecordingRequest( @@ -1736,7 +1735,7 @@ public void ShouldCallsStopRecording() SetUpPostRequest(CALL_STOP_RECORDING_ENDPOINT.Replace("{callId}", givenCallId), 200, null, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var response = api.CallStopRecording(givenCallId); @@ -1768,7 +1767,7 @@ public void ShouldCallsStartStreamingMedia() SetUpPostRequest(START_MEDIA_STREAM_ENDPOINT.Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsStartMediaStreamRequest( new CallsMediaStream( @@ -1799,7 +1798,7 @@ public void ShouldCallsStopStreamingMedia() SetUpPostRequest(STOP_MEDIA_STREAM_ENDPOINT.Replace("{callId}", givenCallId), 200, null, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var response = api.StopMediaStream(givenCallId); @@ -1828,7 +1827,7 @@ public void ShouldCallsRequestApplicationTransfer() SetUpPostRequest(APPLICATION_TRANSFER.Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsApplicationTransferRequest( "dc5942707c704551a00cd2ea", @@ -1859,7 +1858,7 @@ public void ShouldCallsAcceptApplicationTransfer() APPLICATION_TRANSFER_ACCEPT.Replace("{callId}", givenCallId).Replace("{transferId}", givenTransferId), 200, null, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var response = api.ApplicationTransferAccept(givenCallId, givenTransferId); @@ -1881,7 +1880,7 @@ public void ShouldCallsRejectApplicationTransfer() APPLICATION_TRANSFER_REJECT.Replace("{callId}", givenCallId).Replace("{transferId}", givenTransferId), 200, null, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var response = api.ApplicationTransferReject(givenCallId, givenTransferId); @@ -1962,7 +1961,7 @@ public void ShouldGetConferences() SetUpGetRequest(GET_CONFERENCES, 200, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var response = api.GetConferences( givenName, @@ -2082,7 +2081,7 @@ public void ShouldCreateConference() SetUpPostRequest(CREATE_CONFERENCE, 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsConferenceRequest( callsConfigurationId: "dc5942707c704551a00cd2ea", @@ -2188,7 +2187,7 @@ public void ShouldGetConference() SetUpGetRequest(GET_CONFERENCE.Replace("{conferenceId}", givenConferenceId), 200, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var response = api.GetConference(givenConferenceId); @@ -2249,7 +2248,7 @@ public void ShouldUpdateAllCalls() SetUpPatchRequest(UPDATE_CONFERENCE.Replace("{conferenceId}", givenConferenceId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsUpdateRequest( false, @@ -2398,7 +2397,7 @@ public void ShouldGetConferencesHistory() SetUpGetRequest(GET_CONFERENCES_HISTORY, 200, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsConferenceLogPage( new List @@ -2512,7 +2511,6 @@ public void ShouldGetConferencesHistory() 1 ) ); - ; var response = api.GetConferencesHistory(givenName, givenCallId, givenCallsConfigurationId, givenApplicationId, givenStartTimeAfter, givenEndTimeBefore, givenPage, givenSize); @@ -2625,7 +2623,7 @@ public void ShouldGetConferenceHistory() SetUpGetRequest(GET_CONFERENCE_HISTORY.Replace("{conferenceId}", givenConferenceId), 200, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsConferenceLog( "034e622a-cc7e-456d-8a10-0ba43b11aa5e", @@ -2839,7 +2837,7 @@ public void ShouldAddNewCall() SetUpPostRequest(ADD_NEW_CONFERENCE_CALL.Replace("{conferenceId}", givenConferenceId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsAddNewCallRequest( new CallsActionCallRequest( @@ -2974,7 +2972,7 @@ public void ShouldAddExistingCall() ADD_EXISTING_CONFERENCE_CALL.Replace("{conferenceId}", givenConferenceId).Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsAddExistingCallRequest( false, @@ -3030,7 +3028,7 @@ public void ShouldRemoveCall() REMOVE_CONFERENCE_CALL.Replace("{conferenceId}", givenConferenceId).Replace("{callId}", givenCallId), 200, expectedResponse: givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsActionResponse( CallsActionStatus.Pending @@ -3062,7 +3060,7 @@ public void ShouldUpdateCall() UPDATE_CONFERENCE_CALL.Replace("{conferenceId}", givenConferenceId).Replace("{callId}", givenCallId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsUpdateRequest( false, @@ -3135,7 +3133,7 @@ public void ShouldHangupConference() SetUpPostRequest(HANGUP_CONFERENCE.Replace("{conferenceId}", givenConferenceId), 200, expectedResponse: givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsConference( "034e622a-cc7e-456d-8a10-0ba43b11aa5e", @@ -3198,7 +3196,7 @@ public void ShouldConferencesPlayFile() SetUpPostRequest(CONFERENCE_PLAY_FILE.Replace("{conferenceId}", givenConferenceId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsConferencePlayRequest( content: new CallsFilePlayContent( @@ -3228,7 +3226,7 @@ public void ShouldConferencesStopPlayingFile() SetUpPostRequest(CONFERENCE_STOP_PLAYING_FILE.Replace("{conferenceId}", givenConferenceId), 200, expectedResponse: givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsActionResponse( CallsActionStatus.Pending @@ -3263,7 +3261,7 @@ public void ShouldConferencesSayText() SetUpPostRequest(CONFERENCE_SAY_TEXT.Replace("{conferenceId}", givenConferenceId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsSayRequest( "string", @@ -3305,7 +3303,7 @@ public void ShouldConferencesStartRecording() SetUpPostRequest(CONFERENCE_START_RECORDING.Replace("{conferenceId}", givenConferenceId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsConferenceRecordingRequest( CallsRecordingType.Audio, @@ -3336,7 +3334,7 @@ public void ShouldConferencesStopRecording() SetUpPostRequest(CONFERENCE_STOP_RECORDING.Replace("{conferenceId}", givenConferenceId), 200, expectedResponse: givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsActionResponse( CallsActionStatus.Pending @@ -3365,7 +3363,7 @@ public void ShouldConferencesBroadcastText() SetUpPostRequest(CONFERENCE_BROADCAST_WEBRTC_TEXT.Replace("{conferenceId}", givenConferenceId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsConferenceBroadcastWebrtcTextRequest( "This meeting will end in 5 minutes." @@ -3481,7 +3479,7 @@ public void ShouldGetDialogs() SetUpGetRequest(GET_DIALOGS, 200, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsDialogPage( new List @@ -3653,7 +3651,7 @@ public void ShouldCreateDialog() SetUpPostRequest(CREATE_DIALOG, 201, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsDialogRequest( "d8d84155-3831-43fb-91c9-bb897149a79d", @@ -3837,7 +3835,7 @@ public void ShouldCreateDialogWithExistingCalls() CREATE_DIALOG_WITH_EXISTING_CALLS.Replace("{parentCallId}", givenParentCallId) .Replace("{childCallId}", givenChildCallId), 201, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsDialogWithExistingCallRequest( new CallsDialogRecordingRequest( @@ -3987,7 +3985,7 @@ public void ShouldGetDialog() SetUpGetRequest(GET_DIALOG.Replace("{dialogId}", givenDialogId), 200, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsDialogResponse( "034e622a-cc7e-456d-8a10-0ba43b11aa5e", @@ -4172,7 +4170,7 @@ public void ShouldGetDialogsHistory() SetUpGetRequest(GET_DIALOGS_HISTORY, 200, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsDialogLogPage( new List @@ -4381,7 +4379,7 @@ public void ShouldGetDialogHistory() SetUpGetRequest(GET_DIALOG_HISTORY.Replace("{dialogId}", givenDialogId), 200, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsDialogLogResponse( "034e622a-cc7e-456d-8a10-0ba43b11aa5e", @@ -4554,7 +4552,7 @@ public void ShouldHangupDialog() SetUpPostRequest(HANGUP_DIALOG.Replace("{dialogId}", givenDialogId), 200, expectedResponse: givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsDialogResponse( "034e622a-cc7e-456d-8a10-0ba43b11aa5e", @@ -4633,7 +4631,7 @@ public void ShouldDialogsPlayFile() SetUpPostRequest(DIALOG_PLAY_FILE.Replace("{dialogId}", givenDialogId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsDialogPlayRequest( 3, @@ -4675,7 +4673,7 @@ public void ShouldDialogsSayText() SetUpPostRequest(DIALOG_SAY_TEXT.Replace("{dialogId}", givenDialogId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsDialogSayRequest( "Hello world", @@ -4710,7 +4708,7 @@ public void ShouldDialogsStopPlayingFile() SetUpPostRequest(DIALOG_STOP_PLAYING_FILE.Replace("{dialogId}", givenDialogId), 200, expectedResponse: givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsActionResponse( CallsActionStatus.Pending @@ -4746,7 +4744,7 @@ public void ShouldDialogsStartRecording() SetUpPostRequest(DIALOG_START_RECORDING.Replace("{dialogId}", givenDialogId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsDialogRecordingRequest( CallsRecordingType.AudioAndVideo, @@ -4783,7 +4781,7 @@ public void ShouldDialogsStopRecording() SetUpPostRequest(DIALOG_STOP_RECORDING.Replace("{dialogId}", givenDialogId), 200, expectedResponse: givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsActionResponse( CallsActionStatus.Pending @@ -4812,7 +4810,7 @@ public void ShouldDialogsBroadcastText() SetUpPostRequest(DIALOG_BROADCAST_WEBRTC_TEXT.Replace("{dialogId}", givenDialogId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsDialogBroadcastWebrtcTextRequest( "This dialog will end in 5 minutes." @@ -4925,7 +4923,7 @@ public void ShouldGetSipTrunks() SetUpGetRequest(GET_SIP_TRUNKS, 200, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsSipTrunkPage( new List @@ -5103,7 +5101,7 @@ public void ShouldCreateSipTrunk() SetUpPostRequest(CREATE_SIP_TRUNK, 202, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsStaticSipTrunkRequest( name: "Static SIP trunk", @@ -5240,7 +5238,7 @@ public void ShouldGetSipTrunk() SetUpGetRequest(GET_SIP_TRUNK.Replace("{sipTrunkId}", givenSipTrunkId), 200, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsStaticSipTrunkResponse( id: "a8cbf843-12b9-4ad6-be1e-d186fe63963d", @@ -5370,7 +5368,7 @@ public void ShouldUpdateSipTrunk() SetUpPutRequest(UPDATE_SIP_TRUNK.Replace("{sipTrunkId}", givenSipTrunkId), 202, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsStaticSipTrunkUpdateRequest( name: "Static SIP trunk", @@ -5500,7 +5498,7 @@ public void ShouldDeleteSipTrunk() SetUpDeleteRequest(DELETE_SIP_TRUNK.Replace("{sipTrunkId}", givenSipTrunkId), 202, expectedResponse: givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsStaticSipTrunkResponse( id: "a8cbf843-12b9-4ad6-be1e-d186fe63963d", @@ -5566,7 +5564,7 @@ public void ShouldResetRegisteredSipTrunkPassword() SetUpPostRequest(RESET_SIP_TRUNK_PASSWORD.Replace("{sipTrunkId}", givenSipTrunkId), 200, expectedResponse: givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsSipTrunkRegistrationCredentials( "426c8402-691c-11ee-8c99-0242ac120002", @@ -5596,7 +5594,7 @@ public void ShouldGetSipTrunkStatus() SetUpGetRequest(GET_SIP_TRUNK_STATUS.Replace("{sipTrunkId}", givenSipTrunkId), 200, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsExtendedSipTrunkStatusResponse( CallsSipTrunkAdminStatus.Disabled, @@ -5630,7 +5628,7 @@ public void ShouldSetSipTrunkStatus() SetUpPostRequest(SET_SIP_TRUNK_STATUS.Replace("{sipTrunkId}", givenSipTrunkId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsSipTrunkStatusRequest( CallsSipTrunkAdminStatus.Enabled @@ -5692,7 +5690,7 @@ public void ShouldGetSipTrunkServiceAddresses() SetUpGetRequest(GET_SIP_TRUNK_SERVICE_ADDRESSES, 200, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsSipTrunkServiceAddressPage( new List @@ -5761,7 +5759,7 @@ public void ShouldCreateSipTrunkServiceAddresses() SetUpPostRequest(CREATE_SIP_TRUNK_SERVICE_ADDRESS, 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsPublicSipTrunkServiceAddressRequest( "Location address name", @@ -5822,7 +5820,7 @@ public void ShouldGetSipTrunkServiceAddress() GET_SIP_TRUNK_SERVICE_ADDRESS.Replace("{sipTrunkServiceAddressId}", givenSipTrunkServiceAddressId), 200, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsPublicSipTrunkServiceAddress( "abc-def-ghi", @@ -5884,7 +5882,7 @@ public void ShouldUpdateSipTrunkServiceAddress() UPDATE_SIP_TRUNK_SERVICE_ADDRESS.Replace("{sipTrunkServiceAddressId}", givenSipTrunkServiceAddressId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsPublicSipTrunkServiceAddressRequest( "Location address name", @@ -5945,7 +5943,7 @@ public void ShouldDeleteSipTrunkServiceAddress() DELETE_SIP_TRUNK_SERVICE_ADDRESS.Replace("{sipTrunkServiceAddressId}", givenSipTrunkServiceAddressId), 200, expectedResponse: givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsPublicSipTrunkServiceAddress( "abc-def-ghi", @@ -5990,7 +5988,7 @@ public void ShouldGetCountries() SetUpGetRequest(GET_COUNTRIES, 200, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new List { @@ -6043,7 +6041,7 @@ public void ShouldGetRegions() SetUpGetRequest(GET_REGIONS, 200, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new List { @@ -6104,7 +6102,7 @@ public void ShouldGetFiles() SetUpGetRequest(GET_CALLS_FILES, 200, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsFilePage( new List @@ -6157,7 +6155,7 @@ public void ShouldUploadAudioFile() SetUpMultipartFormRequest(UPLOAD_CALLS_AUDIO_FILE, parts, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsFile( "218eceba-c044-430d-9f26-8f1a7f0g2d03", @@ -6194,7 +6192,7 @@ public void ShouldGetFile() SetUpGetRequest(GET_CALLS_FILE.Replace("{fileId}", givenFileId), 200, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsFile( "218eceba-c044-430d-9f26-8f1a7f0g2d03", @@ -6231,7 +6229,7 @@ public void ShouldDeleteFile() SetUpDeleteRequest(DELETE_CALLS_FILE.Replace("{fileId}", givenFileId), 200, expectedResponse: givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsFile( "218eceba-c044-430d-9f26-8f1a7f0g2d03", @@ -6347,7 +6345,7 @@ public void ShouldGetCallsRecordings() SetUpGetRequest(GET_CALLS_RECORDINGS, 200, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallRecordingPage( new List @@ -6463,7 +6461,7 @@ public void ShouldGetCallRecordings() SetUpGetRequest(GET_CALL_RECORDINGS.Replace("{callId}", givenCallId), 200, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallRecording( "d8d84155-3831-43fb-91c9-bb897149a79d", @@ -6539,7 +6537,7 @@ public void ShouldDeleteCallRecordings() SetUpDeleteRequest(DELETE_CALL_RECORDINGS.Replace("{callId}", givenCallId), 200, expectedResponse: givenResponse, givenParameters: givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallRecording( "d8d84155-3831-43fb-91c9-bb897149a79d", @@ -6702,7 +6700,7 @@ public void ShouldGetConferencesRecordings() SetUpGetRequest(GET_CONFERENCES_RECORDINGS, 200, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsConferenceRecordingPage( new List @@ -6901,7 +6899,7 @@ public void ShouldGetConferenceRecordings() SetUpGetRequest(GET_CONFERENCE_RECORDINGS.Replace("{conferenceId}", givenConferenceId), 200, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsConferenceRecording( "034e622a-cc7e-456d-8a10-0ba43b11aa5e", @@ -7087,7 +7085,7 @@ public void ShouldDeleteConferenceRecording() SetUpDeleteRequest(DELETE_CONFERENCE_RECORDINGS.Replace("{conferenceId}", givenConferenceId), 200, expectedResponse: givenResponse, givenParameters: givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsConferenceRecording( "034e622a-cc7e-456d-8a10-0ba43b11aa5e", @@ -7205,7 +7203,7 @@ public void ShouldComposeConferenceRecordingOnCalls() SetUpPostRequest(COMPOSE_CONFERENCE_RECORDING.Replace("{conferenceId}", givenConferenceId), 200, givenRequest, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsOnDemandComposition( true, @@ -7347,7 +7345,7 @@ public void ShouldGetDialogsRecordings() SetUpGetRequest(GET_DIALOGS_RECORDINGS, 200, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsDialogRecordingPage( new List @@ -7542,7 +7540,7 @@ public void ShouldGetDialogRecordings() SetUpGetRequest(GET_DIALOG_RECORDINGS.Replace("{dialogId}", givenDialogId), 200, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsDialogRecordingResponse( "034e622a-cc7e-456d-8a10-0ba43b11aa5e", @@ -7724,7 +7722,7 @@ public void ShouldDeleteDialogRecordings() SetUpDeleteRequest(DELETE_DIALOG_RECORDINGS.Replace("{dialogId}", givenDialogId), 200, expectedResponse: givenResponse, givenParameters: givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsDialogRecordingResponse( "034e622a-cc7e-456d-8a10-0ba43b11aa5e", @@ -7840,7 +7838,7 @@ public void ShouldComposeDialogRecordingOnCalls() SetUpPostRequest(COMPOSE_DIALOG_RECORDING.Replace("{dialogId}", givenDialogId), 200, givenRequest, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsOnDemandComposition( true, @@ -7888,7 +7886,7 @@ public void ShouldDeleteRecordingFile() SetUpDeleteRequest(DELETE_RECORDING_FILE.Replace("{fileId}", givenFileId), 200, expectedResponse: givenResponse, givenParameters: givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsRecordingFile( "b72cde3c-7d9c-4a5c-8e48-5a947244c013", @@ -7950,7 +7948,7 @@ public void ShouldGetMediaStreamConfigs() SetUpGetRequest(GET_MEDIA_STREAM_CONFIGS, 200, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsMediaStreamConfigPage( new List @@ -8005,7 +8003,7 @@ public void ShouldCreateMediaStreamConfiguration() SetUpPostRequest(CREATE_MEDIA_STREAM_CONFIG, 201, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsMediaStreamingConfigRequest( name: "Media-stream config", @@ -8044,7 +8042,7 @@ public void ShouldGetMediaStreamConfiguration() SetUpGetRequest(GET_MEDIA_STREAM_CONFIG.Replace("{mediaStreamConfigId}", givenMediaStreamConfigId), 200, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsMediaStreamConfigResponse( "63467c6e2885a5389ba11d80", @@ -8086,7 +8084,7 @@ public void ShouldUpdateMediaStreamConfiguration() SetUpPutRequest(UPDATE_MEDIA_STREAM_CONFIG.Replace("{mediaStreamConfigId}", givenMediaStreamConfigId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsMediaStreamingConfigRequest( name: "Media-stream config", @@ -8125,7 +8123,7 @@ public void ShouldDeleteMediaStreamConfiguration() SetUpDeleteRequest(DELETE_MEDIA_STREAM_CONFIG.Replace("{mediaStreamConfigId}", givenMediaStreamConfigId), 200, expectedResponse: givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsMediaStreamConfigResponse( "63467c6e2885a5389ba11d80", @@ -8268,7 +8266,7 @@ public void ShouldCreateBulkCalls() SetUpPostRequest(CREATE_BULK, 201, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallBulkRequest( "46ab0413-448f-4153-ada9-b68b14242dc3", @@ -8407,7 +8405,7 @@ public void ShouldGetBulkStatus() SetUpGetRequest(GET_BULK_STATUS.Replace("{bulkId}", givenBulkId), 200, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallBulkStatus( "46ab0413-448f-4153-ada9-b68b14242dc3", @@ -8439,7 +8437,7 @@ public void ShouldRescheduleBulk() SetUpPostRequest(RESCHEDULE_BULK.Replace("{bulkId}", givenBulkId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsRescheduleRequest( DateTimeOffset.Parse("2025-02-19T12:44:30Z") @@ -8470,7 +8468,7 @@ public void ShouldPauseBulk() SetUpPostRequest(PAUSE_BULK.Replace("{bulkId}", givenBulkId), 200, expectedResponse: givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallBulkStatus( "46ab0413-448f-4153-ada9-b68b14242dc3", @@ -8497,7 +8495,7 @@ public void ShouldResumeBulk() SetUpPostRequest(RESUME_BULK.Replace("{bulkId}", givenBulkId), 200, expectedResponse: givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallBulkStatus( "46ab0413-448f-4153-ada9-b68b14242dc3", @@ -8524,7 +8522,7 @@ public void ShouldCancelBulk() SetUpPostRequest(CANCEL_BULK.Replace("{bulkId}", givenBulkId), 200, expectedResponse: givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallBulkStatus( "46ab0413-448f-4153-ada9-b68b14242dc3", @@ -8566,7 +8564,7 @@ public void ShouldGetCallsConfigurations() SetUpGetRequest(CALLS_CONFIGURATIONS, 200, givenResponse, givenQueryParameters); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsConfigurationPage( new List @@ -8606,7 +8604,7 @@ public void ShouldCreateCallsConfiguration() SetUpPostRequest(CALLS_CONFIGURATIONS, 201, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsConfigurationCreateRequest( "63467c6e2885a5389ba11d80", @@ -8637,7 +8635,7 @@ public void ShouldGetCallsConfiguration() SetUpGetRequest(CALLS_CONFIGURATION.Replace("{callsConfigurationId}", givenCallsConfigurationId), 200, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsConfigurationResponse( "63467c6e2885a5389ba11d80", @@ -8668,7 +8666,7 @@ public void ShouldUpdateCallsConfiguration() SetUpPutRequest(CALLS_CONFIGURATION.Replace("{callsConfigurationId}", givenCallsConfigurationId), 200, givenRequest, givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var request = new CallsConfigurationUpdateRequest( "Calls configuration" @@ -8698,7 +8696,7 @@ public void ShouldDeleteCallsConfiguration() SetUpDeleteRequest(CALLS_CONFIGURATION.Replace("{callsConfigurationId}", givenCallsConfigurationId), 200, expectedResponse: givenResponse); - var api = new CallsApi(configuration); + var api = new CallsApi(Configuration); var expectedResponse = new CallsConfigurationResponse( "63467c6e2885a5389ba11d80", diff --git a/ApiClient.Tests/Api/ClickToCallApiTest.cs b/ApiClient.Tests/Api/ClickToCallApiTest.cs index abfdfe4..7793323 100644 --- a/ApiClient.Tests/Api/ClickToCallApiTest.cs +++ b/ApiClient.Tests/Api/ClickToCallApiTest.cs @@ -1,6 +1,5 @@ using Infobip.Api.Client.Api; using Infobip.Api.Client.Model; -using Microsoft.VisualStudio.TestTools.UnitTesting; namespace ApiClient.Tests.Api; @@ -122,7 +121,7 @@ public void ShouldSendClickToCallMessage() SetUpPostRequest(SEND_CTC_ENDPOINT, 200, givenRequest, expectedResponse); - var clickToCallApi = new ClickToCallApi(configuration); + var clickToCallApi = new ClickToCallApi(Configuration); var callsClickToCallMessageBody = new CallsClickToCallMessageBody( givenBulkId, diff --git a/ApiClient.Tests/Api/EmailApiTest.cs b/ApiClient.Tests/Api/EmailApiTest.cs index da55660..67aaef5 100644 --- a/ApiClient.Tests/Api/EmailApiTest.cs +++ b/ApiClient.Tests/Api/EmailApiTest.cs @@ -126,7 +126,7 @@ public void ShouldSendEmailTest() SetUpMultipartFormRequest(EMAIL_SEND_FULLY_FEATURED_ENDPOINT, parts, expectedResponse); - var sendEmailApi = new EmailApi(configuration); + var sendEmailApi = new EmailApi(Configuration); var expectedToList = new List { @@ -232,7 +232,7 @@ public void ShouldSendEmailWithAttachmentTest() SetUpMultipartFormRequest(EMAIL_SEND_FULLY_FEATURED_ENDPOINT, parts, expectedResponse); - var sendEmailApi = new EmailApi(configuration); + var sendEmailApi = new EmailApi(Configuration); var expectedToList = new List { @@ -327,7 +327,7 @@ public void ShouldGetEmailLogsTest() SetUpGetRequest(EMAIL_LOGS_ENDPOINT, 200, expectedResponse); - var sendEmailApi = new EmailApi(configuration); + var sendEmailApi = new EmailApi(Configuration); var response = sendEmailApi.GetEmailDeliveryReports(expectedBulkId, expectedMessageId, limit: 2); @@ -405,7 +405,7 @@ public void ShouldGetEmailDeliveryReportsTest() SetUpGetRequest(EMAIL_REPORTS_ENDPOINT, 200, expectedResponse); - var sendEmailApi = new EmailApi(configuration); + var sendEmailApi = new EmailApi(Configuration); var response = sendEmailApi.GetEmailLogs( bulkId: expectedBulkId, @@ -453,7 +453,7 @@ public void ShouldGetScheduledEmailsTest() SetUpGetRequest(EMAIL_BULKS_ENDPOINT, 200, expectedResponse); - var scheduledEmailApi = new EmailApi(configuration); + var scheduledEmailApi = new EmailApi(Configuration); var response = scheduledEmailApi.GetScheduledEmails(expectedBulkId); @@ -483,7 +483,7 @@ public void ShouldRescheduleEmailsTest() SetUpPutRequest(EMAIL_BULKS_ENDPOINT, 200, givenRequest, expectedResponse); - var scheduledEmailApi = new EmailApi(configuration); + var scheduledEmailApi = new EmailApi(Configuration); var rescheduleRequest = new EmailBulkRescheduleRequest(expectedSentAt); var response = scheduledEmailApi.RescheduleEmails(expectedBulkId, rescheduleRequest); @@ -519,7 +519,7 @@ public void ShouldGetScheduledEmailStatusTest() SetUpGetRequest(EMAIL_BULKS_STATUS_ENDPOINT, 200, expectedResponse); - var scheduledEmailApi = new EmailApi(configuration); + var scheduledEmailApi = new EmailApi(Configuration); var response = scheduledEmailApi.GetScheduledEmailStatuses(expectedBulkId); @@ -550,7 +550,7 @@ public void ShouldUpdateEmailStatusTest() SetUpPutRequest(EMAIL_BULKS_STATUS_ENDPOINT, 200, givenRequest, expectedResponse); - var scheduledEmailApi = new EmailApi(configuration); + var scheduledEmailApi = new EmailApi(Configuration); var updateStatusRequest = new EmailBulkUpdateStatusRequest(expectedStatus); @@ -589,7 +589,7 @@ public void ValidateEmailAddressesTest() SetUpPostRequest(EMAIL_VALIDATE_ADDRESSES_ENDPOINT, 200, givenRequest, expectedResponse); - var emailValidationApi = new EmailApi(configuration); + var emailValidationApi = new EmailApi(Configuration); var validationRequest = new EmailValidationRequest(expectedTo); @@ -667,7 +667,7 @@ public void ShouldGetAllDomainsForTheAccount() SetUpGetRequest(EMAIL_DOMAINS, 200, expectedResponse, expectedQueryParameters); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); void AssertEmailAllDomainsResponse(EmailAllDomainsResponse emailAllDomainsResponse) { @@ -759,7 +759,7 @@ public void ShouldAddNewDomain() SetUpPostRequest(EMAIL_DOMAINS, 200, givenRequest, expectedResponse); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); var emailAddDomainRequest = new EmailAddDomainRequest( expectedDomainName, @@ -839,7 +839,7 @@ public void ShouldGetDomainDetails() SetUpGetRequest(EMAIL_DOMAIN.Replace("{domainName}", expectedDomainName), 200, expectedResponse); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); void AssertEmailDomainResponse(EmailDomainResponse emailDomainResponse) { @@ -875,7 +875,7 @@ public void ShouldDeleteExistingDomain() SetUpDeleteRequest(EMAIL_DOMAIN.Replace("{domainName}", givenDomainName), 204); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); AssertNoBodyResponseWithHttpInfo(emailApi.DeleteDomainWithHttpInfo(givenDomainName), 204); AssertNoBodyResponseWithHttpInfo(emailApi.DeleteDomainWithHttpInfoAsync(givenDomainName).Result, @@ -932,7 +932,7 @@ public void ShouldUpdateTrackingEvents() SetUpPutRequest(EMAIL_DOMAIN_TRACKING.Replace("{domainName}", expectedDomainName), 200, givenRequest, expectedResponse); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); var emailTrackingEventRequest = new EmailTrackingEventRequest( expectedOpens, @@ -1019,7 +1019,7 @@ public void ShouldUpdateReturnPath() SetUpPutRequest(EMAIL_DOMAIN_RETURN_PATH.Replace("{domainName}", expectedDomainName), 200, givenRequest, expectedResponse); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); var emailReturnPathAddressRequest = new EmailReturnPathAddressRequest( expectedReturnPathAddress @@ -1063,7 +1063,7 @@ public void ShouldVerifyDomain() SetUpPostRequest(EMAIL_DOMAIN_VERIFY.Replace("{domainName}", givenDomainName), 202); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); AssertNoBodyResponseWithHttpInfo(emailApi.VerifyDomainWithHttpInfo(givenDomainName), 202); AssertNoBodyResponseWithHttpInfo(emailApi.VerifyDomainWithHttpInfoAsync(givenDomainName).Result, @@ -1113,7 +1113,7 @@ public void ShouldGetSuppresions() SetUpGetRequest(EMAIL_SUPPRESIONS_ENDPOINT, 200, expectedResponse, givenQueryParameters); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); void AssertEmailSuppressionInfoPageResponse(EmailSuppressionInfoPageResponse emailSuppressionInfoPageResponse) { @@ -1206,7 +1206,7 @@ public void ShouldAddSuppresions() SetUpPostRequest(EMAIL_SUPPRESIONS_ENDPOINT, 204, givenRequest); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); AssertNoBodyResponseWithHttpInfo( emailApi.AddSuppressionsWithHttpInfo(emailAddSuppressionRequest), 204); @@ -1292,7 +1292,7 @@ public void ShouldDeleteSuppresions() SetUpDeleteRequest(EMAIL_SUPPRESIONS_ENDPOINT, 204, givenRequest); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); AssertNoBodyResponseWithHttpInfo( emailApi.DeleteSuppressionsWithHttpInfo(emailDeleteSuppressionRequest), 204); @@ -1370,7 +1370,7 @@ public void ShouldGetSuppresionDomains() SetUpGetRequest(EMAIL_SUPPRESIONS_DOMAINS_ENDPOINT, 200, expectedResponse, givenQueryParameters); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); void AssertEmailDomainInfoPageResponse(EmailDomainInfoPageResponse emailDomainInfoPageResponse) { @@ -1431,7 +1431,7 @@ public void ShouldGetIps() SetUpGetRequest(EMAIL_IPS_ENDPOINT, 200, expectedResponse); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); void AssertEmailIpResponse(List emailIpResponses) { @@ -1473,7 +1473,7 @@ public void ShouldGetIp() SetUpGetRequest(EMAIL_IP_ENDPOINT.Replace("{ipId}", givenIpId), 200, expectedResponse); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); void AssertEmailIpDetailResponse(EmailIpDetailResponse emailIpDetailResponse) { @@ -1519,7 +1519,7 @@ public void ShouldGetIpPools() SetUpGetRequest(EMAIL_IP_POOLS_ENDPOINT, 200, expectedResponse, givenQueryParameters); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); void AssertEmailIpPoolResponse(List emailIpPoolResponses) { @@ -1563,7 +1563,7 @@ public void ShouldCreateIpPool() givenName ); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); void AssertEmailIpPoolResponse(EmailIpPoolResponse emailIpPoolResponse) { @@ -1606,7 +1606,7 @@ public void ShouldGetIpPool() SetUpGetRequest(EMAIL_IP_POOL_ENDPOINT.Replace("{poolId}", givenPoolId), 200, expectedResponse); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); void AssertEmailIpPoolDetailResponse(EmailIpPoolDetailResponse emailIpPoolDetailResponse) { @@ -1657,7 +1657,7 @@ public void ShouldUpdateIpPool() givenName ); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); void AssertEmailIpPoolResponse(EmailIpPoolResponse emailIpPoolResponse) { @@ -1684,7 +1684,7 @@ public void ShouldDeletePool() SetUpDeleteRequest(EMAIL_IP_POOL_ENDPOINT.Replace("{poolId}", givenPoolId), 204); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); AssertNoBodyResponseWithHttpInfo(emailApi.DeleteIpPoolWithHttpInfo(givenPoolId), 204); AssertNoBodyResponseWithHttpInfo(emailApi.DeleteIpPoolWithHttpInfoAsync(givenPoolId).Result, 204); @@ -1708,7 +1708,7 @@ public void ShouldAssignIpToPool() SetUpPostRequest(EMAIL_IP_POOLS_IPS_ENDPOINT.Replace("{poolId}", givenPoolId), 204, givenRequest); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); AssertNoBodyResponseWithHttpInfo(emailApi.AssignIpToPoolWithHttpInfo(givenPoolId, emailIpPoolAssignIpRequest), 204); @@ -1725,7 +1725,7 @@ public void ShouldUnassignIpFromPool() SetUpDeleteRequest(EMAIL_IP_POOLS_IP_ENDPOINT.Replace("{poolId}", givenPoolId).Replace("{ipId}", givenIpId), 204); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); AssertNoBodyResponseWithHttpInfo(emailApi.RemoveIpFromPoolWithHttpInfo(givenPoolId, givenIpId), 204); AssertNoBodyResponseWithHttpInfo(emailApi.RemoveIpFromPoolWithHttpInfoAsync(givenPoolId, givenIpId).Result, @@ -1767,7 +1767,7 @@ public void ShouldGetDomain() SetUpGetRequest(EMAIL_IP_DOMAIN_ENDPOINT.Replace("{domainId}", givenDomainId.ToString()), 200, expectedResponse); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); void AssertEmailIpDomainResponse(EmailIpDomainResponse emailIpDomainResponse) { @@ -1822,7 +1822,7 @@ public void ShouldAssignIpPoolToDomain() SetUpPostRequest(EMAIL_IP_DOMAIN_POOLS_ENDPOINT.Replace("{domainId}", givenDomainId.ToString()), 204, givenRequest); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); AssertNoBodyResponseWithHttpInfo( emailApi.AssignPoolToDomainWithHttpInfo(givenDomainId, emailDomainIpPoolAssignRequest), 204); @@ -1851,7 +1851,7 @@ public void ShouldUpdateIpPoolSendingPriority() EMAIL_IP_DOMAIN_POOL_ENDPOINT.Replace("{domainId}", givenDomainId.ToString()) .Replace("{poolId}", givenPoolId), 204, givenRequest); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); AssertNoBodyResponseWithHttpInfo( emailApi.UpdateDomainPoolPriorityWithHttpInfo(givenDomainId, givenPoolId, emailDomainIpPoolUpdateRequest), @@ -1871,7 +1871,7 @@ public void ShouldUnassignIpPoolFromDomain() EMAIL_IP_DOMAIN_POOL_ENDPOINT.Replace("{domainId}", givenDomainId.ToString()) .Replace("{poolId}", givenPoolId), 204); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); AssertNoBodyResponseWithHttpInfo(emailApi.RemoveIpPoolFromDomainWithHttpInfo(givenDomainId, givenPoolId), 204); AssertNoBodyResponseWithHttpInfo( @@ -1889,35 +1889,10 @@ public void SendEmailErrorResponseTest(int errorResponseIndex) var expectedErrorPhrase = ErrorResponses[errorResponseIndex].Item3; var givenTo = "john.smith@example.com"; - var givenMessageCount = 1; - var givenMessageId = "somexternalMessageId"; - var givenGroupId = 1; - var givenGroupName = "PENDING"; - var givenId = 7; - var givenName = "PENDING_ENROUTE"; - var givenDescription = "Message sent to next instance"; var givenFrom = "jane.smith@example.com"; var givenSubject = "Mail subject text"; var givenMailText = "Mail text"; - var givenRequest = $@" - {{ - ""messages"": [ - {{ - ""to"": ""{givenTo}"", - ""messageCount"": {givenMessageCount}, - ""messageId"": ""{givenMessageId}"", - ""status"": {{ - ""groupId"": {givenGroupId}, - ""groupName"": ""{givenGroupName}"", - ""id"": {givenId}, - ""name"": ""{givenName}"", - ""description"": ""{givenDescription}"" - }} - }} - ] - }}"; - var expectedJson = $@" {{ ""requestError"": {{ @@ -1945,7 +1920,7 @@ public void SendEmailErrorResponseTest(int errorResponseIndex) SetUpMultipartFormRequest(EMAIL_SEND_FULLY_FEATURED_ENDPOINT, givenParts, expectedJson, expectedHttpCode); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); var toList = new List { @@ -1954,7 +1929,7 @@ public void SendEmailErrorResponseTest(int errorResponseIndex) try { - var result = emailApi.SendEmail(from: givenFrom, to: toList, subject: givenSubject, text: givenMailText); + emailApi.SendEmail(from: givenFrom, to: toList, subject: givenSubject, text: givenMailText); } catch (ApiException ex) { @@ -2032,20 +2007,20 @@ public void ShouldReceiveEmailDeliveryReport() ] }}"; - var emailWebhookDLRReportResponse = JsonConvert.DeserializeObject(givenResponse); - AssertEmailWebhookDLRReportResponse(emailWebhookDLRReportResponse!); + var emailWebhookDlrReportResponse = JsonConvert.DeserializeObject(givenResponse); + AssertEmailWebhookDlrReportResponse(emailWebhookDlrReportResponse!); - var emailWebhookDLRReportResponseSystemTextJson = + var emailWebhookDlrReportResponseSystemTextJson = JsonSerializer.Deserialize(givenResponse); - AssertEmailWebhookDLRReportResponse(emailWebhookDLRReportResponseSystemTextJson!); + AssertEmailWebhookDlrReportResponse(emailWebhookDlrReportResponseSystemTextJson!); - void AssertEmailWebhookDLRReportResponse(EmailWebhookDLRReportResponse emailWebhookDLRReportResponse) + void AssertEmailWebhookDlrReportResponse(EmailWebhookDLRReportResponse emailWebhookDlrReportResponse) { - Assert.IsNotNull(emailWebhookDLRReportResponse); - Assert.IsNotNull(emailWebhookDLRReportResponse.Results); - Assert.AreEqual(1, emailWebhookDLRReportResponse.Results.Count); + Assert.IsNotNull(emailWebhookDlrReportResponse); + Assert.IsNotNull(emailWebhookDlrReportResponse.Results); + Assert.AreEqual(1, emailWebhookDlrReportResponse.Results.Count); - var emailWebhookDeliveryReport = emailWebhookDLRReportResponse.Results[0]; + var emailWebhookDeliveryReport = emailWebhookDlrReportResponse.Results[0]; Assert.AreEqual(givenBulkId, emailWebhookDeliveryReport.BulkId); Assert.AreEqual(givenPricePerMessage, emailWebhookDeliveryReport.Price.PricePerMessage); @@ -2169,12 +2144,11 @@ public void GetEmailDeliveryReportsResponseTest(int errorResponseIndex) SetUpGetRequest(EMAIL_LOGS_ENDPOINT, expectedHttpCode, expectedJson); - var emailApi = new EmailApi(configuration); + var emailApi = new EmailApi(Configuration); try { - var result = - emailApi.GetEmailDeliveryReports(messageId: givenMessageId, bulkId: givenBulkId, limit: givenLimit); + emailApi.GetEmailDeliveryReports(messageId: givenMessageId, bulkId: givenBulkId, limit: givenLimit); } catch (ApiException ex) { diff --git a/ApiClient.Tests/Api/FlowApiTest.cs b/ApiClient.Tests/Api/FlowApiTest.cs index 05e8606..ff05718 100644 --- a/ApiClient.Tests/Api/FlowApiTest.cs +++ b/ApiClient.Tests/Api/FlowApiTest.cs @@ -1,6 +1,5 @@ using Infobip.Api.Client.Api; using Infobip.Api.Client.Model; -using Microsoft.VisualStudio.TestTools.UnitTesting; namespace ApiClient.Tests.Api; @@ -87,7 +86,7 @@ public void ShouldAddParticipantsToFlow() SetUpPostRequest(FLOW_ADD_PARTICIPANTS_ENDPOINT.Replace("{campaignId}", givenCampaignId.ToString()), 200, givenRequest, expectedResponse); - var flowApi = new FlowApi(configuration); + var flowApi = new FlowApi(Configuration); var addFlowParticipantsRequest = new FlowAddFlowParticipantsRequest( new List @@ -199,7 +198,7 @@ public void ShouldGetAReportOnParticipantsAddedToFlow() SetUpGetRequest(FLOW_GET_PARTICIPANTS_REPORT_ENDPOINT.Replace("{campaignId}", expectedCampaignId.ToString()), 200, expectedResponse, givenQueryParameters); - var flowApi = new FlowApi(configuration); + var flowApi = new FlowApi(Configuration); void AssertFlowParticipantsReportResponse(FlowParticipantsReportResponse flowParticipantsReportResponse) { @@ -252,7 +251,7 @@ public void ShouldRemovePersonFromFlow() SetUpDeleteRequest(FLOW_DELETE_PARTICIPANTS_ENDPOINT.Replace("{campaignId}", givenCampaignId.ToString()), 200, givenParameters: givenQueryParameters); - var flowApi = new FlowApi(configuration); + var flowApi = new FlowApi(Configuration); AssertNoBodyResponseWithHttpInfo( flowApi.RemovePeopleFromFlowWithHttpInfo(givenCampaignId, givenPhone, givenEmail, givenExternalId), 200); diff --git a/ApiClient.Tests/Api/FormsApiTest.cs b/ApiClient.Tests/Api/FormsApiTest.cs index f915c2b..e07141d 100644 --- a/ApiClient.Tests/Api/FormsApiTest.cs +++ b/ApiClient.Tests/Api/FormsApiTest.cs @@ -1,6 +1,5 @@ using Infobip.Api.Client.Api; using Infobip.Api.Client.Model; -using Microsoft.VisualStudio.TestTools.UnitTesting; namespace ApiClient.Tests.Api; @@ -121,7 +120,7 @@ public void ShouldGetForms() SetUpGetRequest(FORMS_ENDPOINT, 200, expectedResponse, givenQueryParameters); - var formsApi = new FormsApi(configuration); + var formsApi = new FormsApi(Configuration); void AssertFormsResponse(FormsResponse formsResponse) { @@ -288,7 +287,7 @@ public void ShouldGetForm() SetUpGetRequest(FORM_ENDPOINT.Replace("{id}", expectedId), 200, expectedResponse); - var formsApi = new FormsApi(configuration); + var formsApi = new FormsApi(Configuration); void AssertFormsResponseContent(FormsResponseContent formsResponseContent) { @@ -371,7 +370,7 @@ public void ShouldIncrementFormViewCount() SetUpPostRequest(FORM_VIEW_ENDPOINT.Replace("{id}", givenId), 200, expectedResponse: expectedResponse); - var formsApi = new FormsApi(configuration); + var formsApi = new FormsApi(Configuration); void AssertFormsStatusResponse(FormsStatusResponse formsStatusResponse) { @@ -420,7 +419,7 @@ public void ShouldSubmitFormData() SetUpPostRequest(FORM_DATA_ENDPOINT.Replace("{id}", givenId), 200, givenRequest, expectedResponse); - var formsApi = new FormsApi(configuration); + var formsApi = new FormsApi(Configuration); void AssertFormsStatusResponse(FormsStatusResponse formsStatusResponse) { diff --git a/ApiClient.Tests/Api/NumberMaskingApiTest.cs b/ApiClient.Tests/Api/NumberMaskingApiTest.cs index ee2c4cf..14dc55a 100644 --- a/ApiClient.Tests/Api/NumberMaskingApiTest.cs +++ b/ApiClient.Tests/Api/NumberMaskingApiTest.cs @@ -1,6 +1,5 @@ using Infobip.Api.Client.Api; using Infobip.Api.Client.Model; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using JsonSerializer = System.Text.Json.JsonSerializer; @@ -44,7 +43,7 @@ public void ShouldGetNumberMaskingConfigurations() SetUpGetRequest(NUMBER_MASKING_CONFIGURATIONS_ENDPOINT, 200, expectedResponse); - var numberMaskingApi = new NumberMaskingApi(configuration); + var numberMaskingApi = new NumberMaskingApi(Configuration); void AssertNumberMaskingSetupResponse(List numberMaskingSetupResponses) { @@ -107,7 +106,7 @@ public void ShouldCreateNumberMaskingConfiguration() SetUpPostRequest(NUMBER_MASKING_CONFIGURATIONS_ENDPOINT, 200, givenRequest, expectedResponse); - var numberMaskingApi = new NumberMaskingApi(configuration); + var numberMaskingApi = new NumberMaskingApi(Configuration); var numberMaskingSetupBody = new NumberMaskingSetupBody( givenName, @@ -164,7 +163,7 @@ public void ShouldGetNumberMaskingConfiguration() SetUpGetRequest(NUMBER_MASKING_CONFIGURATION_ENDPOINT.Replace("{key}", givenKey), 200, expectedResponse); - var numberMaskingApi = new NumberMaskingApi(configuration); + var numberMaskingApi = new NumberMaskingApi(Configuration); void AssertNumberMaskingSetupResponse(NumberMaskingSetupResponse numberMaskingSetupResponse) { @@ -224,7 +223,7 @@ public void ShouldUpdateNumberMaskingConfiguration() SetUpPutRequest(NUMBER_MASKING_CONFIGURATION_ENDPOINT.Replace("{key}", givenKey), 200, givenRequest, expectedResponse); - var numberMaskingApi = new NumberMaskingApi(configuration); + var numberMaskingApi = new NumberMaskingApi(Configuration); var numberMaskingSetupBody = new NumberMaskingSetupBody( givenName, @@ -264,7 +263,7 @@ public void ShouldDeleteNumberMaskingConfiguration() SetUpDeleteRequest(NUMBER_MASKING_CONFIGURATION_ENDPOINT.Replace("{key}", givenKey), 200); - var numberMaskingApi = new NumberMaskingApi(configuration); + var numberMaskingApi = new NumberMaskingApi(Configuration); AssertNoBodyResponseWithHttpInfo(numberMaskingApi.DeleteNumberMaskingConfigurationWithHttpInfo(givenKey), 200); AssertNoBodyResponseWithHttpInfo( @@ -290,7 +289,7 @@ public void ShouldUploadAudioFiles() SetUpPostRequest(NUMBER_MASKING_UPLOAD_ENDPOINT, 200, givenRequest, expectedResponse); - var numberMaskingApi = new NumberMaskingApi(configuration); + var numberMaskingApi = new NumberMaskingApi(Configuration); var numberMaskingUploadBody = new NumberMaskingUploadBody( givenUrl @@ -480,7 +479,7 @@ public void ShouldGetNumberMaskingCredentials() SetUpGetRequest(NUMBER_MASKING_CREDENTIALS_ENDPOINT, 200, expectedResponse); - var numberMaskingApi = new NumberMaskingApi(configuration); + var numberMaskingApi = new NumberMaskingApi(Configuration); void AssertNumberMaskingCredentialsResponse(NumberMaskingCredentialsResponse numberMaskingCredentialsResponse) { @@ -521,7 +520,7 @@ public void ShouldUpdateNumberMaskingCredentials() SetUpPutRequest(NUMBER_MASKING_CREDENTIALS_ENDPOINT, 200, givenRequest, expectedResponse); - var numberMaskingApi = new NumberMaskingApi(configuration); + var numberMaskingApi = new NumberMaskingApi(Configuration); var numberMaskingCredentialsBody = new NumberMaskingCredentialsBody( givenApiId, @@ -570,7 +569,7 @@ public void ShouldCreateNumberMaskingCredentials() SetUpPostRequest(NUMBER_MASKING_CREDENTIALS_ENDPOINT, 200, givenRequest, expectedResponse); - var numberMaskingApi = new NumberMaskingApi(configuration); + var numberMaskingApi = new NumberMaskingApi(Configuration); var numberMaskingCredentialsBody = new NumberMaskingCredentialsBody( givenApiId, @@ -601,7 +600,7 @@ public void ShouldDeleteNumberMaskingCredentials() { SetUpDeleteRequest(NUMBER_MASKING_CREDENTIALS_ENDPOINT, 204); - var numberMaskingApi = new NumberMaskingApi(configuration); + var numberMaskingApi = new NumberMaskingApi(Configuration); AssertNoBodyResponseWithHttpInfo(numberMaskingApi.DeleteNumberMaskingCredentialsWithHttpInfo(), 204); AssertNoBodyResponseWithHttpInfo(numberMaskingApi.DeleteNumberMaskingCredentialsWithHttpInfoAsync().Result, diff --git a/ApiClient.Tests/Api/SmsApiTest.cs b/ApiClient.Tests/Api/SmsApiTest.cs index c26a0e0..ce323e9 100644 --- a/ApiClient.Tests/Api/SmsApiTest.cs +++ b/ApiClient.Tests/Api/SmsApiTest.cs @@ -1,6 +1,5 @@ using Infobip.Api.Client.Api; using Infobip.Api.Client.Model; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using JsonSerializer = System.Text.Json.JsonSerializer; @@ -10,8 +9,6 @@ namespace ApiClient.Tests.Api; public class SmsApiTest : ApiTest { protected const string SMS_SEND_MESSAGE_ENDPOINT = "/sms/3/messages"; - protected const string SMS_SEND_TEXT_ADVANCED_ENDPOINT = "/sms/2/text/advanced"; - protected const string SMS_SEND_BINARY_ADVANCED_ENDPOINT = "/sms/2/binary/advanced"; protected const string SMS_LOGS_ENDPOINT = "/sms/3/logs"; protected const string SMS_REPORTS_ENDPOINT = "/sms/3/reports"; protected const string SMS_INBOX_REPORTS_ENDPOINT = "/sms/1/inbox/reports"; @@ -96,7 +93,7 @@ public void ShouldSendSimpleSms() ) }); - var sendSmsApi = new SmsApi(configuration); + var sendSmsApi = new SmsApi(Configuration); var response = sendSmsApi.SendSmsMessages(request); @@ -195,7 +192,7 @@ public void ShouldSendFlashSms() ) }); - var sendSmsApi = new SmsApi(configuration); + var sendSmsApi = new SmsApi(Configuration); var response = sendSmsApi.SendSmsMessages(request); @@ -427,7 +424,7 @@ public void ShouldSendFullyFeaturedSmsMessage() new UrlOptions(shortenUrl, trackClicks, trackingUrl, removeProtocol, customDomain), includeSmsCountInResponse, new SmsTracking(useConversionTracking, conversionTrackingName))); - var smsApi = new SmsApi(configuration); + var smsApi = new SmsApi(Configuration); var response = smsApi.SendSmsMessages(request); var expectedResponse = new SmsResponse( @@ -663,7 +660,7 @@ public void ShouldSendFullyFeaturedBinarySms() new UrlOptions(shortenUrl, trackClicks, trackingUrl, removeProtocol, customDomain), includeSmsCountInResponse, new SmsTracking(useConversionTracking, conversionTrackingName))); - var smsApi = new SmsApi(configuration); + var smsApi = new SmsApi(Configuration); var response = smsApi.SendSmsMessages(request); var expectedResponse = new SmsResponse( @@ -898,7 +895,7 @@ public void ShouldSendFlashBinarySms() new UrlOptions(shortenUrl, trackClicks, trackingUrl, removeProtocol, customDomain), includeSmsCountInResponse, new SmsTracking(useConversionTracking, conversionTrackingName))); - var smsApi = new SmsApi(configuration); + var smsApi = new SmsApi(Configuration); var response = smsApi.SendSmsMessages(request); var expectedResponse = new SmsResponse( @@ -1029,7 +1026,7 @@ public void ShouldGetOutboundLogs() SetUpGetRequest(SMS_LOGS_ENDPOINT, 200, expectedResponse, new Dictionary { { "bulkId", bulkId }, {"generalStatus", GetEnumAttributeValue(MessageGeneralStatus.Accepted)}}); - var smsApiClient = new SmsApi(configuration); + var smsApiClient = new SmsApi(Configuration); var actualResponse = smsApiClient.GetOutboundSmsMessageLogs(bulkId: new List {bulkId}, generalStatus: MessageGeneralStatus.Accepted); var expectedDeserializedLogs = new SmsLogsResponse(new List @@ -1163,7 +1160,7 @@ public void ShouldGetOutboundDeliveryReports() SetUpGetRequest(SMS_REPORTS_ENDPOINT, 200, expectedResponse, new Dictionary { { "bulkId", bulkId } }); - var smsApiClient = new SmsApi(configuration); + var smsApiClient = new SmsApi(Configuration); var actualResponse = smsApiClient.GetOutboundSmsMessageDeliveryReports(bulkId); var expectedDeserializedReport = new SmsDeliveryResult(new List @@ -1264,7 +1261,7 @@ void ResultAssertions(SmsInboundMessageResult smsInboundResult) Assert.AreEqual(expectedCallbackData, message.CallbackData); } - var receiveApi = new SmsApi(configuration); + var receiveApi = new SmsApi(Configuration); AssertResponse(receiveApi.GetInboundSmsMessages(givenLimit), ResultAssertions); AssertResponse(receiveApi.GetInboundSmsMessagesAsync(givenLimit).Result, ResultAssertions); @@ -1321,7 +1318,7 @@ void SmsPreviewAssertions(SmsPreviewResponse response) Assert.IsNull(smsLanguage.Transliteration); } - var sendSmsApi = new SmsApi(configuration); + var sendSmsApi = new SmsApi(Configuration); var request = new SmsPreviewRequest(expectedTextPreview); AssertResponse(sendSmsApi.PreviewSmsMessage(request), SmsPreviewAssertions); @@ -1353,7 +1350,7 @@ void BulkResponseAssertions(SmsBulkResponse response) Assert.AreEqual(DateTimeOffset.Parse(expectedSendAt), response.SendAt); } - var scheduledSmsApi = new SmsApi(configuration); + var scheduledSmsApi = new SmsApi(Configuration); AssertResponse(scheduledSmsApi.GetScheduledSmsMessages(expectedBulkId), BulkResponseAssertions); AssertResponse(scheduledSmsApi.GetScheduledSmsMessagesAsync(expectedBulkId).Result, BulkResponseAssertions); @@ -1392,7 +1389,7 @@ void BulkResponseAssertions(SmsBulkResponse response) Assert.AreEqual(DateTimeOffset.Parse(expectedSendAt), response.SendAt); } - var scheduledSmsApi = new SmsApi(configuration); + var scheduledSmsApi = new SmsApi(Configuration); var bulkRequest = new SmsBulkRequest(DateTimeOffset.Parse(givenSendAtWithColon)); AssertResponse(scheduledSmsApi.RescheduleSmsMessages(expectedBulkId, bulkRequest), BulkResponseAssertions); @@ -1428,7 +1425,7 @@ void BulkResponseAssertions(SmsBulkStatusResponse response) Assert.AreEqual(expectedBulkStatus, response.Status); } - var scheduledSmsApi = new SmsApi(configuration); + var scheduledSmsApi = new SmsApi(Configuration); AssertResponse(scheduledSmsApi.GetScheduledSmsMessagesStatus(expectedBulkId), BulkResponseAssertions); AssertResponse(scheduledSmsApi.GetScheduledSmsMessagesStatusAsync(expectedBulkId).Result, @@ -1470,7 +1467,7 @@ void BulkResponseAssertions(SmsBulkStatusResponse response) Assert.AreEqual(expectedBulkStatus, response.Status); } - var scheduledSmsApi = new SmsApi(configuration); + var scheduledSmsApi = new SmsApi(Configuration); var updateStatusRequest = new SmsUpdateStatusRequest(SmsBulkStatus.Paused); AssertResponse(scheduledSmsApi.UpdateScheduledSmsMessagesStatus(expectedBulkId, updateStatusRequest), diff --git a/ApiClient.Tests/Api/TfaApiTest.cs b/ApiClient.Tests/Api/TfaApiTest.cs index 424421b..02903d9 100644 --- a/ApiClient.Tests/Api/TfaApiTest.cs +++ b/ApiClient.Tests/Api/TfaApiTest.cs @@ -1,7 +1,6 @@ using System.Globalization; using Infobip.Api.Client.Api; using Infobip.Api.Client.Model; -using Microsoft.VisualStudio.TestTools.UnitTesting; namespace ApiClient.Tests.Api; @@ -102,7 +101,7 @@ public void ShouldGetTfaApplicationsTest() SetUpGetRequest(TFA_APPLICATIONS, 200, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); void AssertTfaGetApplicationsResponse(List tfaApplicationResponses) { @@ -210,7 +209,7 @@ public void ShouldCreateTfaApplicationTest() SetUpPostRequest(TFA_APPLICATIONS, 200, givenRequest, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); var tfaApplicationConfiguration = new TfaApplicationConfiguration { @@ -277,7 +276,7 @@ public void ShouldGetTfaApplicationTest() SetUpGetRequest(TFA_APPLICATION.Replace("{appId}", expectedApplicationId), 200, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); void AssertTfaGetApplicationResponse(TfaApplicationResponse tfaApplicationResponse) { @@ -351,7 +350,7 @@ public void ShouldUpdateTfaApplicationTest() SetUpPutRequest(TFA_APPLICATION.Replace("{appId}", expectedApplicationId), 200, givenRequest, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); var tfaApplicationConfiguration = new TfaApplicationConfiguration { @@ -421,7 +420,7 @@ public void ShouldGetTfaMessageTemplatesTest() SetUpGetRequest(TFA_TEMPLATES.Replace("{appId}", givenApplicationId), 200, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); void AssertTfaGetTemplatesResponse(List tfaMessages) { @@ -487,7 +486,7 @@ public void ShouldCreateTfaMessageTemplateTest() SetUpPostRequest(TFA_TEMPLATES.Replace("{appId}", givenApplicationId), 200, givenRequest, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); var tfaCreateMessageRequest = new TfaCreateMessageRequest( Enum.Parse(expectedLanguage, true), @@ -555,7 +554,7 @@ public void ShouldGetTfaMessageTemplateTest() SetUpGetRequest(TFA_TEMPLATE.Replace("{appId}", givenApplicationId).Replace("{msgId}", givenMessageId), 200, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); void AssertTfaGetTemplateResponse(TfaMessage tfaMessage) { @@ -623,7 +622,7 @@ public void ShouldUpdateTfaMessageTemplateTest() SetUpPutRequest(TFA_TEMPLATE.Replace("{appId}", givenApplicationId).Replace("{msgId}", givenMessageId), 200, givenRequest, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); var tfaUpdateMessageRequest = new TfaUpdateMessageRequest( Enum.Parse(expectedLanguage, true), @@ -693,7 +692,7 @@ public void ShouldCreateTfaEmailMessageTemplateTest() SetUpPostRequest(TFA_EMAIL_TEMPLATES.Replace("{appId}", expectedApplicationId), 200, givenRequest, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); var tfaCreateEmailMessageRequest = new TfaCreateEmailMessageRequest( pinType: expectedPinType, @@ -759,7 +758,7 @@ public void ShouldUpdateTfaEmailMessageTemplateTest() TFA_EMAIL_TEMPLATE.Replace("{appId}", expectedApplicationId).Replace("{msgId}", expectedMessageId), 200, givenRequest, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); var tfaUpdateEmailMessageRequest = new TfaUpdateEmailMessageRequest( pinType: expectedPinType, @@ -828,7 +827,7 @@ public void ShouldSendTfaPinCodeViaSmsTest() SetUpPostRequest(TFA_SEND_PIN, 200, givenRequest, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); var givenPlaceholders = new Dictionary { { "firstName", givenFirstName } }; var tfaStartAuthenticationRequest = new TfaStartAuthenticationRequest( @@ -886,7 +885,7 @@ public void ShouldResendTfaPinCodeViaSmsTest() SetUpPostRequest(TFA_RESEND_PIN.Replace("{pinId}", expectedPinId), 200, givenRequest, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); var tfaResendPinRequest = new TfaResendPinRequest { @@ -946,7 +945,7 @@ public void ShouldSendTfaPinCodeViaVoiceTest() SetUpPostRequest(TFA_SEND_PIN_VOICE, 200, givenRequest, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); var givenPlaceholders = new Dictionary { { "firstName", givenFirstName } }; var tfaStartAuthenticationRequest = new TfaStartAuthenticationRequest( @@ -1002,7 +1001,7 @@ public void ShouldResendTfaPinCodeViaVoiceTest() SetUpPostRequest(TFA_RESEND_PIN_VOICE.Replace("{pinId}", expectedPinId), 200, givenRequest, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); var tfaResendPinRequest = new TfaResendPinRequest { @@ -1019,7 +1018,7 @@ void AssertTfaStartAuthenticationResponse(TfaStartAuthenticationResponse tfaStar AssertResponse(tfaApi.ResendTfaPinCodeOverVoice(expectedPinId, tfaResendPinRequest), AssertTfaStartAuthenticationResponse); - ; + AssertResponse(tfaApi.ResendTfaPinCodeOverVoiceAsync(expectedPinId, tfaResendPinRequest).Result, AssertTfaStartAuthenticationResponse); @@ -1065,7 +1064,7 @@ public void ShouldSendTfaPinCodeViaEmailTest() SetUpPostRequest(TFA_SEND_PIN_EMAIL, 200, givenRequest, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); var givenPlaceholders = new Dictionary { { "firstName", givenFirstName } }; @@ -1128,7 +1127,7 @@ public void ShouldResendTfaPinCodeViaEmailTest() SetUpPostRequest(TFA_RESEND_PIN_EMAIL.Replace("{pinId}", expectedPinId), 200, givenRequest, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); var tfaResendPinRequest = new TfaResendPinRequest { @@ -1148,7 +1147,7 @@ void AssertTfaStartAuthenticationResponse( AssertResponse(tfaApi.Resend2faPinCodeOverEmail(expectedPinId, tfaResendPinRequest), AssertTfaStartAuthenticationResponse); - ; + AssertResponse(tfaApi.Resend2faPinCodeOverEmailAsync(expectedPinId, tfaResendPinRequest).Result, AssertTfaStartAuthenticationResponse); @@ -1184,7 +1183,7 @@ public void ShouldVerifyTfaCallTest() SetUpPostRequest(TFA_VERIFY_PIN.Replace("{pinId}", expectedPinId), 200, givenRequest, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); var tfaVerifyPinRequest = new TfaVerifyPinRequest(givenPin); @@ -1198,7 +1197,7 @@ void AssertTfaVerifyPinResponse(TfaVerifyPinResponse tfaVerifyPinResponse) } AssertResponse(tfaApi.VerifyTfaPhoneNumber(expectedPinId, tfaVerifyPinRequest), AssertTfaVerifyPinResponse); - ; + AssertResponse(tfaApi.VerifyTfaPhoneNumberAsync(expectedPinId, tfaVerifyPinRequest).Result, AssertTfaVerifyPinResponse); @@ -1242,7 +1241,7 @@ public void ShouldGetTfaVerificationStatusTest() SetUpGetRequest(TFA_VERIFICATION_STATUS.Replace("{appId}", givenApplicationId), 200, expectedResponse); - var tfaApi = new TfaApi(configuration); + var tfaApi = new TfaApi(Configuration); void AssertTfaVerificationResponse(TfaVerificationResponse tfaVerificationResponse) { @@ -1265,7 +1264,7 @@ void AssertTfaVerificationResponse(TfaVerificationResponse tfaVerificationRespon AssertResponse(tfaApi.GetTfaVerificationStatus(expectedMsisdn, givenApplicationId), AssertTfaVerificationResponse); - ; + AssertResponse(tfaApi.GetTfaVerificationStatusAsync(expectedMsisdn, givenApplicationId).Result, AssertTfaVerificationResponse); diff --git a/ApiClient.Tests/Api/VoiceApiTest.cs b/ApiClient.Tests/Api/VoiceApiTest.cs index 5adaa6f..778ec47 100644 --- a/ApiClient.Tests/Api/VoiceApiTest.cs +++ b/ApiClient.Tests/Api/VoiceApiTest.cs @@ -2,7 +2,6 @@ using Infobip.Api.Client.Api; using Infobip.Api.Client.Client; using Infobip.Api.Client.Model; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using JsonSerializer = System.Text.Json.JsonSerializer; @@ -80,7 +79,7 @@ public void ShouldSendSingeVoiceMessage() SetUpPostRequest(VOICE_SINGLE_ENDPOINT, 200, givenRequest, expectedResponse); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); var callsSingleBody = new CallsSingleBody( text: givenText, @@ -92,7 +91,6 @@ public void ShouldSendSingeVoiceMessage() from: givenFrom, to: givenTo ); - ; void AssertCallsVoiceResponse(CallsVoiceResponse callsVoiceResponse) { @@ -205,7 +203,7 @@ public void ShouldSendMultipleVoiceMessages() SetUpPostRequest(VOICE_MULTI_ENDPOINT, 200, givenRequest, expectedResponse); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); var callsMultiBody = new CallsMultiBody( new List @@ -444,7 +442,7 @@ public void ShouldSendAdvancedMessage() SetUpPostRequest(VOICE_ADVANCED_ENDPOINT, 200, givenRequest, expectedResponse); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); var callsAdvancedBody = new CallsAdvancedBody( givenBulkId, @@ -638,7 +636,7 @@ public void ShouldGetVoices() SetUpGetRequest(VOICE_LANGUAGE_ENDPOINT.Replace("{language}", givenLanguage), 200, expectedResponse, givenQueryParamters); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); void AssertCallsGetVoicesResponse(CallsGetVoicesResponse callsGetVoicesResponse) { @@ -704,7 +702,7 @@ public void ShouldGetSentBulks() SetUpGetRequest(VOICE_BULKS_ENDPOINT, 200, expectedResponse, givenQueryParamters); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); void AssertCallsBulkResponse(CallsBulkResponse callsBulkResponse) { @@ -747,7 +745,7 @@ public void ShouldRescheduleSentBulk() SetUpPutRequest(VOICE_BULKS_ENDPOINT, 200, givenRequest, expectedResponse, givenQueryParamters); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); var callsBulkRequest = new CallsBulkRequest( givenSendAt @@ -788,7 +786,7 @@ public void ShouldGetSentBulksStatus() SetUpGetRequest(VOICE_BULKS_STATUS_ENDPOINT, 200, expectedResponse, givenQueryParamters); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); void AssertCallsBulkStatusResponse(CallsBulkStatusResponse callsBulkStatusResponse) { @@ -832,7 +830,7 @@ public void ShouldManageSentBulksStatus() SetUpPutRequest(VOICE_BULKS_STATUS_ENDPOINT, 200, givenRequest, expectedResponse, givenQueryParamters); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); var callsUpdateStatusRequest = new CallsUpdateStatusRequest( givenStatus @@ -954,51 +952,51 @@ public void ShouldGetVoiceDeliveryReports() SetUpGetRequest(VOICE_REPORTS_ENDPOINT, 200, expectedResponse, givenQueryParamters); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); void AssertCallsReportResponse(CallsReportResponse callsReportResponse) { Assert.IsNotNull(callsReportResponse); var results = callsReportResponse.Results; - Assert.IsNotNull(callsReportResponse.Results); - Assert.AreEqual(1, callsReportResponse.Results.Count); - - Assert.AreEqual(expectedBulkId, callsReportResponse.Results[0].BulkId); - Assert.AreEqual(expectedMessageId, callsReportResponse.Results[0].MessageId); - Assert.AreEqual(expectedFrom, callsReportResponse.Results[0].From); - Assert.AreEqual(expectedTo, callsReportResponse.Results[0].To); - Assert.AreEqual(expectedSentAt, callsReportResponse.Results[0].SentAt); - Assert.AreEqual(expectedMccMnc, callsReportResponse.Results[0].MccMnc); - Assert.AreEqual(expectedCallbackData, callsReportResponse.Results[0].CallbackData); - Assert.AreEqual(expectedFeature, callsReportResponse.Results[0].VoiceCall.Feature); - Assert.AreEqual(expectedStartTime, callsReportResponse.Results[0].VoiceCall.StartTime); - Assert.AreEqual(expectedAnswerTime, callsReportResponse.Results[0].VoiceCall.AnswerTime); - Assert.AreEqual(expectedEndTime, callsReportResponse.Results[0].VoiceCall.EndTime); - Assert.AreEqual(expectedDuration, callsReportResponse.Results[0].VoiceCall.Duration); - Assert.AreEqual(expectedChargedDuration, callsReportResponse.Results[0].VoiceCall.ChargedDuration); - Assert.AreEqual(expectedFileDuration, callsReportResponse.Results[0].VoiceCall.FileDuration); - Assert.AreEqual(expectedDtmfCodes, callsReportResponse.Results[0].VoiceCall.DtmfCodes); - Assert.AreEqual(expectedScenarioId, callsReportResponse.Results[0].VoiceCall.Ivr.ScenarioId); - Assert.AreEqual(expectedScenarioName, callsReportResponse.Results[0].VoiceCall.Ivr.ScenarioName); + Assert.IsNotNull(results); + Assert.AreEqual(1, results.Count); + + Assert.AreEqual(expectedBulkId, results[0].BulkId); + Assert.AreEqual(expectedMessageId, results[0].MessageId); + Assert.AreEqual(expectedFrom, results[0].From); + Assert.AreEqual(expectedTo, results[0].To); + Assert.AreEqual(expectedSentAt, results[0].SentAt); + Assert.AreEqual(expectedMccMnc, results[0].MccMnc); + Assert.AreEqual(expectedCallbackData, results[0].CallbackData); + Assert.AreEqual(expectedFeature, results[0].VoiceCall.Feature); + Assert.AreEqual(expectedStartTime, results[0].VoiceCall.StartTime); + Assert.AreEqual(expectedAnswerTime, results[0].VoiceCall.AnswerTime); + Assert.AreEqual(expectedEndTime, results[0].VoiceCall.EndTime); + Assert.AreEqual(expectedDuration, results[0].VoiceCall.Duration); + Assert.AreEqual(expectedChargedDuration, results[0].VoiceCall.ChargedDuration); + Assert.AreEqual(expectedFileDuration, results[0].VoiceCall.FileDuration); + Assert.AreEqual(expectedDtmfCodes, results[0].VoiceCall.DtmfCodes); + Assert.AreEqual(expectedScenarioId, results[0].VoiceCall.Ivr.ScenarioId); + Assert.AreEqual(expectedScenarioName, results[0].VoiceCall.Ivr.ScenarioName); Assert.AreEqual("{\"myFirstVar\":\"3\",\"mySecondVar\":\"9\"}", - callsReportResponse.Results[0].VoiceCall.Ivr.CollectedDtmfs); - Assert.AreEqual(null, callsReportResponse.Results[0].VoiceCall.Ivr.CollectedMappedDtmfs); - Assert.AreEqual(null, callsReportResponse.Results[0].VoiceCall.Ivr.SpokenInput); - Assert.AreEqual(null, callsReportResponse.Results[0].VoiceCall.Ivr.MatchedSpokenInput); - Assert.AreEqual(expectedPricePerSecond, callsReportResponse.Results[0].Price.PricePerSecond); - Assert.AreEqual(expectedCurrency, callsReportResponse.Results[0].Price.Currency); - Assert.AreEqual(expectedStatusGroupId, callsReportResponse.Results[0].Status.GroupId); - Assert.AreEqual(expectedStatusGroupName, callsReportResponse.Results[0].Status.GroupName); - Assert.AreEqual(expectedStatusId, callsReportResponse.Results[0].Status.Id); - Assert.AreEqual(expectedStatusName, callsReportResponse.Results[0].Status.Name); - Assert.AreEqual(expectedStatusDescription, callsReportResponse.Results[0].Status.Description); - Assert.AreEqual(expectedErrorGroupId, callsReportResponse.Results[0].Error.GroupId); - Assert.AreEqual(expectedErrorGroupName, callsReportResponse.Results[0].Error.GroupName); - Assert.AreEqual(expectedErrorId, callsReportResponse.Results[0].Error.Id); - Assert.AreEqual(expectedErrorName, callsReportResponse.Results[0].Error.Name); - Assert.AreEqual(expectedErrorDescription, callsReportResponse.Results[0].Error.Description); - Assert.AreEqual(expectedErrorPermanent, callsReportResponse.Results[0].Error.Permanent); + results[0].VoiceCall.Ivr.CollectedDtmfs); + Assert.AreEqual(null, results[0].VoiceCall.Ivr.CollectedMappedDtmfs); + Assert.AreEqual(null, results[0].VoiceCall.Ivr.SpokenInput); + Assert.AreEqual(null, results[0].VoiceCall.Ivr.MatchedSpokenInput); + Assert.AreEqual(expectedPricePerSecond, results[0].Price.PricePerSecond); + Assert.AreEqual(expectedCurrency, results[0].Price.Currency); + Assert.AreEqual(expectedStatusGroupId, results[0].Status.GroupId); + Assert.AreEqual(expectedStatusGroupName, results[0].Status.GroupName); + Assert.AreEqual(expectedStatusId, results[0].Status.Id); + Assert.AreEqual(expectedStatusName, results[0].Status.Name); + Assert.AreEqual(expectedStatusDescription, results[0].Status.Description); + Assert.AreEqual(expectedErrorGroupId, results[0].Error.GroupId); + Assert.AreEqual(expectedErrorGroupName, results[0].Error.GroupName); + Assert.AreEqual(expectedErrorId, results[0].Error.Id); + Assert.AreEqual(expectedErrorName, results[0].Error.Name); + Assert.AreEqual(expectedErrorDescription, results[0].Error.Description); + Assert.AreEqual(expectedErrorPermanent, results[0].Error.Permanent); } AssertResponse(voiceApi.GetVoiceDeliveryReports(givenBulkId, givenMessageId, givenLimit), @@ -1083,37 +1081,37 @@ public void ShouldGetSentVoiceLogs() SetUpGetRequest(VOICE_LOGS_ENDPOINT, 200, expectedResponse, givenQueryParamters); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); void AssertCallsLogsResponse(CallsLogsResponse callsLogsResponse) { Assert.IsNotNull(callsLogsResponse); var results = callsLogsResponse.Results; - Assert.IsNotNull(callsLogsResponse.Results); - Assert.AreEqual(1, callsLogsResponse.Results.Count); - - Assert.AreEqual(expectedBulkId, callsLogsResponse.Results[0].BulkId); - Assert.AreEqual(expectedMessageId, callsLogsResponse.Results[0].MessageId); - Assert.AreEqual(expectedTo, callsLogsResponse.Results[0].To); - Assert.AreEqual(expectedFrom, callsLogsResponse.Results[0].From); - Assert.AreEqual(expectedSentAt, callsLogsResponse.Results[0].SentAt); - Assert.AreEqual(expectedDoneAt, callsLogsResponse.Results[0].DoneAt); - Assert.AreEqual(expectedDuration, callsLogsResponse.Results[0].Duration); - Assert.AreEqual(expectedMccMnc, callsLogsResponse.Results[0].MccMnc); - Assert.AreEqual(expectedPricePerSecond, callsLogsResponse.Results[0].Price.PricePerSecond); - Assert.AreEqual(expectedCurrency, callsLogsResponse.Results[0].Price.Currency); - Assert.AreEqual(expectedStatusGroupId, callsLogsResponse.Results[0].Status.GroupId); - Assert.AreEqual(expectedStatusGroupName, callsLogsResponse.Results[0].Status.GroupName); - Assert.AreEqual(expectedStatusId, callsLogsResponse.Results[0].Status.Id); - Assert.AreEqual(expectedStatusName, callsLogsResponse.Results[0].Status.Name); - Assert.AreEqual(expectedStatusDescription, callsLogsResponse.Results[0].Status.Description); - Assert.AreEqual(expectedErrorGroupId, callsLogsResponse.Results[0].Error.GroupId); - Assert.AreEqual(expectedErrorGroupName, callsLogsResponse.Results[0].Error.GroupName); - Assert.AreEqual(expectedErrorId, callsLogsResponse.Results[0].Error.Id); - Assert.AreEqual(expectedErrorName, callsLogsResponse.Results[0].Error.Name); - Assert.AreEqual(expectedErrorDescription, callsLogsResponse.Results[0].Error.Description); - Assert.AreEqual(expectedErrorPermanent, callsLogsResponse.Results[0].Error.Permanent); + Assert.IsNotNull(results); + Assert.AreEqual(1, results.Count); + + Assert.AreEqual(expectedBulkId, results[0].BulkId); + Assert.AreEqual(expectedMessageId, results[0].MessageId); + Assert.AreEqual(expectedTo, results[0].To); + Assert.AreEqual(expectedFrom, results[0].From); + Assert.AreEqual(expectedSentAt, results[0].SentAt); + Assert.AreEqual(expectedDoneAt, results[0].DoneAt); + Assert.AreEqual(expectedDuration, results[0].Duration); + Assert.AreEqual(expectedMccMnc, results[0].MccMnc); + Assert.AreEqual(expectedPricePerSecond, results[0].Price.PricePerSecond); + Assert.AreEqual(expectedCurrency, results[0].Price.Currency); + Assert.AreEqual(expectedStatusGroupId, results[0].Status.GroupId); + Assert.AreEqual(expectedStatusGroupName, results[0].Status.GroupName); + Assert.AreEqual(expectedStatusId, results[0].Status.Id); + Assert.AreEqual(expectedStatusName, results[0].Status.Name); + Assert.AreEqual(expectedStatusDescription, results[0].Status.Description); + Assert.AreEqual(expectedErrorGroupId, results[0].Error.GroupId); + Assert.AreEqual(expectedErrorGroupName, results[0].Error.GroupName); + Assert.AreEqual(expectedErrorId, results[0].Error.Id); + Assert.AreEqual(expectedErrorName, results[0].Error.Name); + Assert.AreEqual(expectedErrorDescription, results[0].Error.Description); + Assert.AreEqual(expectedErrorPermanent, results[0].Error.Permanent); } AssertResponse(voiceApi.GetSentVoiceLogs(limit: givenLimit), AssertCallsLogsResponse); @@ -1221,49 +1219,49 @@ void AssertCallsReportResponse(CallsReportResponse callsReportResponse) Assert.IsNotNull(callsReportResponse); var results = callsReportResponse.Results; - Assert.IsNotNull(callsReportResponse.Results); - Assert.AreEqual(1, callsReportResponse.Results.Count); - - Assert.AreEqual(expectedBulkId, callsReportResponse.Results[0].BulkId); - Assert.AreEqual(expectedMessageId, callsReportResponse.Results[0].MessageId); - Assert.AreEqual(expectedFrom, callsReportResponse.Results[0].From); - Assert.AreEqual(expectedTo, callsReportResponse.Results[0].To); - Assert.AreEqual(expectedSentAt, callsReportResponse.Results[0].SentAt); - Assert.AreEqual(expectedMccMnc, callsReportResponse.Results[0].MccMnc); - Assert.AreEqual(expectedCallbackData, callsReportResponse.Results[0].CallbackData); - Assert.AreEqual(expectedFeature, callsReportResponse.Results[0].VoiceCall.Feature); - Assert.AreEqual(expectedStartTime, callsReportResponse.Results[0].VoiceCall.StartTime); - Assert.AreEqual(expectedAnswerTime, callsReportResponse.Results[0].VoiceCall.AnswerTime); - Assert.AreEqual(expectedEndTime, callsReportResponse.Results[0].VoiceCall.EndTime); - Assert.AreEqual(expectedDuration, callsReportResponse.Results[0].VoiceCall.Duration); - Assert.AreEqual(expectedChargedDuration, callsReportResponse.Results[0].VoiceCall.ChargedDuration); - Assert.AreEqual(expectedFileDuration, callsReportResponse.Results[0].VoiceCall.FileDuration); - Assert.AreEqual(expectedDtmfCodes, callsReportResponse.Results[0].VoiceCall.DtmfCodes); - Assert.AreEqual(expectedScenarioId, callsReportResponse.Results[0].VoiceCall.Ivr.ScenarioId); - Assert.AreEqual(expectedScenarioName, callsReportResponse.Results[0].VoiceCall.Ivr.ScenarioName); + Assert.IsNotNull(results); + Assert.AreEqual(1, results.Count); + + Assert.AreEqual(expectedBulkId, results[0].BulkId); + Assert.AreEqual(expectedMessageId, results[0].MessageId); + Assert.AreEqual(expectedFrom, results[0].From); + Assert.AreEqual(expectedTo, results[0].To); + Assert.AreEqual(expectedSentAt, results[0].SentAt); + Assert.AreEqual(expectedMccMnc, results[0].MccMnc); + Assert.AreEqual(expectedCallbackData, results[0].CallbackData); + Assert.AreEqual(expectedFeature, results[0].VoiceCall.Feature); + Assert.AreEqual(expectedStartTime, results[0].VoiceCall.StartTime); + Assert.AreEqual(expectedAnswerTime, results[0].VoiceCall.AnswerTime); + Assert.AreEqual(expectedEndTime, results[0].VoiceCall.EndTime); + Assert.AreEqual(expectedDuration, results[0].VoiceCall.Duration); + Assert.AreEqual(expectedChargedDuration, results[0].VoiceCall.ChargedDuration); + Assert.AreEqual(expectedFileDuration, results[0].VoiceCall.FileDuration); + Assert.AreEqual(expectedDtmfCodes, results[0].VoiceCall.DtmfCodes); + Assert.AreEqual(expectedScenarioId, results[0].VoiceCall.Ivr.ScenarioId); + Assert.AreEqual(expectedScenarioName, results[0].VoiceCall.Ivr.ScenarioName); Assert.AreEqual("{\"myFirstVar\":\"3\",\"mySecondVar\":\"9\"}", - callsReportResponse.Results[0].VoiceCall.Ivr.CollectedDtmfs); - Assert.AreEqual(null, callsReportResponse.Results[0].VoiceCall.Ivr.CollectedMappedDtmfs); - Assert.AreEqual(null, callsReportResponse.Results[0].VoiceCall.Ivr.SpokenInput); - Assert.AreEqual(null, callsReportResponse.Results[0].VoiceCall.Ivr.MatchedSpokenInput); - Assert.AreEqual(expectedPricePerSecond, callsReportResponse.Results[0].Price.PricePerSecond); - Assert.AreEqual(expectedCurrency, callsReportResponse.Results[0].Price.Currency); - Assert.AreEqual(expectedStatusGroupId, callsReportResponse.Results[0].Status.GroupId); - Assert.AreEqual(expectedStatusGroupName, callsReportResponse.Results[0].Status.GroupName); - Assert.AreEqual(expectedStatusId, callsReportResponse.Results[0].Status.Id); - Assert.AreEqual(expectedStatusName, callsReportResponse.Results[0].Status.Name); - Assert.AreEqual(expectedStatusDescription, callsReportResponse.Results[0].Status.Description); - Assert.AreEqual(expectedErrorGroupId, callsReportResponse.Results[0].Error.GroupId); - Assert.AreEqual(expectedErrorGroupName, callsReportResponse.Results[0].Error.GroupName); - Assert.AreEqual(expectedErrorId, callsReportResponse.Results[0].Error.Id); - Assert.AreEqual(expectedErrorName, callsReportResponse.Results[0].Error.Name); - Assert.AreEqual(expectedErrorDescription, callsReportResponse.Results[0].Error.Description); - Assert.AreEqual(expectedErrorPermanent, callsReportResponse.Results[0].Error.Permanent); + results[0].VoiceCall.Ivr.CollectedDtmfs); + Assert.AreEqual(null, results[0].VoiceCall.Ivr.CollectedMappedDtmfs); + Assert.AreEqual(null, results[0].VoiceCall.Ivr.SpokenInput); + Assert.AreEqual(null, results[0].VoiceCall.Ivr.MatchedSpokenInput); + Assert.AreEqual(expectedPricePerSecond, results[0].Price.PricePerSecond); + Assert.AreEqual(expectedCurrency, results[0].Price.Currency); + Assert.AreEqual(expectedStatusGroupId, results[0].Status.GroupId); + Assert.AreEqual(expectedStatusGroupName, results[0].Status.GroupName); + Assert.AreEqual(expectedStatusId, results[0].Status.Id); + Assert.AreEqual(expectedStatusName, results[0].Status.Name); + Assert.AreEqual(expectedStatusDescription, results[0].Status.Description); + Assert.AreEqual(expectedErrorGroupId, results[0].Error.GroupId); + Assert.AreEqual(expectedErrorGroupName, results[0].Error.GroupName); + Assert.AreEqual(expectedErrorId, results[0].Error.Id); + Assert.AreEqual(expectedErrorName, results[0].Error.Name); + Assert.AreEqual(expectedErrorDescription, results[0].Error.Description); + Assert.AreEqual(expectedErrorPermanent, results[0].Error.Permanent); } } [TestMethod] - public void ShouldSearchVoiceIVRScenarios() + public void ShouldSearchVoiceIvrScenarios() { var expectedId = "E83E787CF2613450157ADA3476171E3F"; var expectedName = "scenario"; @@ -1340,7 +1338,7 @@ public void ShouldSearchVoiceIVRScenarios() SetUpGetRequest(VOICE_IVR_SCENARIOS_ENDPOINT, 200, expectedResponse, givenQueryParamters); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); void AssertCallsSearchResponse(List callsSearchResponses) { @@ -1378,7 +1376,7 @@ void AssertCallsSearchResponse(List callsSearchResponses) } [TestMethod] - public void ShouldCreateVoiceIVRScenarios() + public void ShouldCreateVoiceIvrScenarios() { var expectedId = "E83E787CF2613450157ADA3476171E3F"; var expectedName = "Capture speech or digit"; @@ -1496,7 +1494,7 @@ public void ShouldCreateVoiceIVRScenarios() SetUpPostRequest(VOICE_IVR_SCENARIOS_ENDPOINT, 200, givenRequest, expectedResponse); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); var callsUpdateScenarioRequest = new CallsUpdateScenarioRequest( givenName, @@ -1524,7 +1522,7 @@ void AssertCallsSearchResponse(CallsUpdateScenarioResponse callsUpdateScenarioRe } [TestMethod] - public void ShouldGetVoiceIVRScenario() + public void ShouldGetVoiceIvrScenario() { var expectedId = "E83E787CF2613450157ADA3476171E3F"; var expectedName = "Scenario name"; @@ -1561,7 +1559,7 @@ public void ShouldGetVoiceIVRScenario() SetUpGetRequest(VOICE_IVR_SCENARIO_ENDPOINT.Replace("{id}", givenId), 200, expectedResponse); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); void AssertCallsSearchResponse(CallsUpdateScenarioResponse callsUpdateScenarioResponse) { @@ -1588,7 +1586,7 @@ void AssertCallsSearchResponse(CallsUpdateScenarioResponse callsUpdateScenarioRe } [TestMethod] - public void ShouldUpdateVoiceIVRScenarios() + public void ShouldUpdateVoiceIvrScenarios() { var expectedId = "E83E787CF2613450157ADA3476171E3F"; var expectedName = "For-Each"; @@ -1644,7 +1642,7 @@ public void ShouldUpdateVoiceIVRScenarios() SetUpPutRequest(VOICE_IVR_SCENARIO_ENDPOINT.Replace("{id}", givenId), 200, givenRequest, expectedResponse); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); var callsUpdateScenarioRequest = new CallsUpdateScenarioRequest( givenName, @@ -1675,20 +1673,20 @@ void AssertCallsSearchResponse(CallsUpdateScenarioResponse callsUpdateScenarioRe } [TestMethod] - public void ShouldDeleteVoiceIVRScenarios() + public void ShouldDeleteVoiceIvrScenarios() { var givenId = "E83E787CF2613450157ADA3476171E3F"; SetUpDeleteRequest(VOICE_IVR_SCENARIO_ENDPOINT.Replace("{id}", givenId), 200); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); AssertNoBodyResponseWithHttpInfo(voiceApi.DeleteAVoiceIvrScenarioWithHttpInfo(givenId), 200); AssertNoBodyResponseWithHttpInfo(voiceApi.DeleteAVoiceIvrScenarioWithHttpInfoAsync(givenId).Result, 200); } [TestMethod] - public void ShouldLaunchVoiceIVRScenarios() + public void ShouldLaunchVoiceIvrScenarios() { var expectedBulkId = "5028e2d42f19-42f1-4656-351e-a42c191e5fd2"; var expectedTo = "41793026727"; @@ -1812,7 +1810,7 @@ public void ShouldLaunchVoiceIVRScenarios() SetUpPostRequest(VOICE_IVR_MESSAGE_ENDPOINT, 200, givenRequest, expectedResponse); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); var callsLaunchScenarioRequest = new CallsLaunchScenarioRequest( givenBulkId, @@ -1957,7 +1955,7 @@ public void ShouldSearchVoiceIvrRecordedFiles() SetUpGetRequest(VOICE_IVR_FILES_ENDPOINT, 200, expectedResponse, givenQueryParameters); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); void AssertCallsRecordedAudioFilesResponses( CallsRecordedAudioFilesResponse callsRecordedAudioFilesResponses) @@ -1990,14 +1988,12 @@ public void ShouldDownloadVoiceIvrRecordedFile() { var expectedContentType = "application/octet-stream"; var expectedContentText = "fileResponse"; - var expectedContent = new MemoryStream(Encoding.UTF8.GetBytes(expectedContentText)); - var expectedFileParameter = new FileParameter(expectedContent); var givenId = "file-id-123"; SetUpGetRequestBinary(VOICE_IVR_FILE_ENDPOINT.Replace("{id}", givenId), 200, expectedContentText); - var voiceApi = new VoiceApi(configuration); + var voiceApi = new VoiceApi(Configuration); void AssertFileParameter(FileParameter fileParameter) { diff --git a/ApiClient.Tests/ApiExceptionTest.cs b/ApiClient.Tests/ApiExceptionTest.cs index ed1c061..91fbc86 100644 --- a/ApiClient.Tests/ApiExceptionTest.cs +++ b/ApiClient.Tests/ApiExceptionTest.cs @@ -77,7 +77,7 @@ public void ErrorResponseTest(int errorResponseIndex) SetUpPostRequest(SMS_MESSAGES_ENDPOINT, httpCode, expectedRequest, responseJson); - var smsApi = new SmsApi(configuration); + var smsApi = new SmsApi(Configuration); var request = new SmsRequest( new List @@ -92,7 +92,7 @@ public void ErrorResponseTest(int errorResponseIndex) try { //It gets exceptions ErrorResponses as defined at the start of the class but for each it throws Newtonsoft.Json.JsonSerializationException: 'Required property 'messages' not found in JSON. - var result = smsApi.SendSmsMessages(request); + smsApi.SendSmsMessages(request); } catch (ApiException ex) { diff --git a/ApiClient.Tests/ClientUtilsTest.cs b/ApiClient.Tests/ClientUtilsTest.cs index 601efa5..4a09087 100644 --- a/ApiClient.Tests/ClientUtilsTest.cs +++ b/ApiClient.Tests/ClientUtilsTest.cs @@ -1,6 +1,5 @@ using System.Runtime.Serialization; using Infobip.Api.Client; -using Microsoft.VisualStudio.TestTools.UnitTesting; namespace ApiClient.Tests; diff --git a/ApiClient.Tests/GeneralSetupTest.cs b/ApiClient.Tests/GeneralSetupTest.cs index 066d4b9..67aa7cd 100644 --- a/ApiClient.Tests/GeneralSetupTest.cs +++ b/ApiClient.Tests/GeneralSetupTest.cs @@ -1,7 +1,6 @@ using System.Net; using ApiClient.Tests.Api; using Infobip.Api.Client; -using Microsoft.VisualStudio.TestTools.UnitTesting; using RestSharp; namespace ApiClient.Tests; @@ -50,13 +49,13 @@ public void UsingExampleFromDocs() SetUpPostRequest(SMS_SEND_TEXT_ADVANCED_ENDPOINT, 200, givenRequest, expectedResponse, new Dictionary { { "param1", "val1" } }); - var client = new RestClient(configuration!.BasePath + SMS_SEND_TEXT_ADVANCED_ENDPOINT) + var client = new RestClient(Configuration!.BasePath + SMS_SEND_TEXT_ADVANCED_ENDPOINT) { UserAgent = "infobip-api-client-csharp/" + Configuration.Version, Timeout = -1 }; var request = new RestRequest(Method.POST); - request.AddHeader("Authorization", configuration.ApiKeyWithPrefix); + request.AddHeader("Authorization", Configuration.ApiKeyWithPrefix); request.AddHeader("Content-Type", "application/json; charset=utf-8"); request.AddHeader("Accept", "application/json"); request.AddQueryParameter("param1", "val1"); From ac2d55f6a561307b6eac53d3cb43979ab5909fb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Vukadinovi=C4=87?= Date: Mon, 8 Dec 2025 11:04:18 +0100 Subject: [PATCH 9/9] Bugfix for Enum deserialization for System.Text.Json. --- ApiClient.Tests/Api/CallRoutingApiTest.cs | 4 +- ApiClient.Tests/Api/NumberMaskingApiTest.cs | 4 +- ApiClient.Tests/Api/SmsApiTest.cs | 16 +++--- CHANGELOG.md | 8 +++ README.md | 6 +-- .../Client/Configuration.cs | 4 +- .../Client/JsonStringEnumMemberConverter.cs | 49 +++++++++++++++++++ .../Infobip.Api.Client.csproj | 6 +-- src/Infobip.Api.Client/Model/CallDirection.cs | 3 +- .../Model/CallEndpointType.cs | 3 +- .../Model/CallRoutingCriteriaType.cs | 3 +- .../Model/CallRoutingDestinationType.cs | 3 +- .../Model/CallRoutingEndpointType.cs | 3 +- .../Model/CallRoutingRecordingType.cs | 3 +- src/Infobip.Api.Client/Model/CallState.cs | 3 +- src/Infobip.Api.Client/Model/CallVoice.cs | 3 +- .../Model/CallsActionStatus.cs | 3 +- .../Model/CallsAnonymizationType.cs | 3 +- .../Model/CallsAudioCodec.cs | 3 +- .../Model/CallsBillingPackageType.cs | 3 +- .../Model/CallsBulkEndpointType.cs | 3 +- .../Model/CallsBulkStatus.cs | 3 +- .../Model/CallsCreationMethod.cs | 3 +- .../Model/CallsDetectionResult.cs | 3 +- .../Model/CallsDialogState.cs | 3 +- src/Infobip.Api.Client/Model/CallsDtmfType.cs | 3 +- .../Model/CallsErrorCode.cs | 3 +- src/Infobip.Api.Client/Model/CallsFaxType.cs | 3 +- .../Model/CallsFileFormat.cs | 3 +- src/Infobip.Api.Client/Model/CallsGender.cs | 3 +- .../Model/CallsGenesysCloudRegion.cs | 3 +- .../Model/CallsHangupSource.cs | 3 +- .../Model/CallsIpCoreGeneralStatus.cs | 3 +- src/Infobip.Api.Client/Model/CallsLanguage.cs | 3 +- .../Model/CallsNumberPresentationFormat.cs | 3 +- .../Model/CallsParticipantState.cs | 3 +- .../Model/CallsPlayContentType.cs | 3 +- .../Model/CallsProviderTrunkType.cs | 3 +- .../Model/CallsRecordingFileLocation.cs | 3 +- .../Model/CallsRecordingLocation.cs | 3 +- .../Model/CallsRecordingStatus.cs | 3 +- .../Model/CallsRecordingType.cs | 3 +- .../CallsRequestMediaStreamConfigType.cs | 3 +- .../CallsResponseMediaStreamConfigType.cs | 3 +- .../Model/CallsSelectionStrategy.cs | 3 +- .../Model/CallsSftpUploadStatus.cs | 3 +- .../Model/CallsSipTrunkActionStatus.cs | 3 +- .../Model/CallsSipTrunkAdminStatus.cs | 3 +- .../Model/CallsSipTrunkRegistrationStatus.cs | 3 +- .../Model/CallsSipTrunkType.cs | 3 +- src/Infobip.Api.Client/Model/CallsStatus.cs | 3 +- .../Model/CallsTerminationType.cs | 3 +- src/Infobip.Api.Client/Model/CallsTimeUnit.cs | 3 +- .../CallsWebsocketEndpointConfigRequest.cs | 2 +- src/Infobip.Api.Client/Model/DeliveryDay.cs | 3 +- .../Model/EmailAddSuppressionType.cs | 3 +- .../Model/EmailBulkStatus.cs | 3 +- .../Model/EmailDomainAccess.cs | 3 +- .../Model/EmailSuppressionType.cs | 3 +- .../Model/FlowAddFlowParticipantStatus.cs | 3 +- .../Model/FlowErrorStatusReason.cs | 3 +- src/Infobip.Api.Client/Model/FlowGender.cs | 3 +- src/Infobip.Api.Client/Model/FlowOrigin.cs | 3 +- .../Model/FlowPersonUniqueFieldType.cs | 3 +- src/Infobip.Api.Client/Model/FlowType.cs | 3 +- .../Model/FormsActionAfterSubmissionType.cs | 3 +- .../Model/FormsComponentType.cs | 3 +- src/Infobip.Api.Client/Model/FormsStatus.cs | 3 +- src/Infobip.Api.Client/Model/FormsType.cs | 3 +- src/Infobip.Api.Client/Model/HmacAlgorithm.cs | 3 +- .../Model/IysRecipientType.cs | 3 +- .../Model/MessageErrorGroup.cs | 3 +- .../Model/MessageGeneralStatus.cs | 3 +- .../Model/NumberMaskingRecordingStatus.cs | 3 +- .../Model/SecurityConfigType.cs | 3 +- src/Infobip.Api.Client/Model/SmsBulkStatus.cs | 3 +- .../Model/SmsLanguageCode.cs | 3 +- .../Model/SmsTransliterationCode.cs | 3 +- .../Model/SpeedLimitTimeUnit.cs | 3 +- src/Infobip.Api.Client/Model/TfaLanguage.cs | 3 +- src/Infobip.Api.Client/Model/TfaPinType.cs | 3 +- .../Model/ValidityPeriodTimeUnit.cs | 3 +- 82 files changed, 151 insertions(+), 167 deletions(-) create mode 100644 src/Infobip.Api.Client/Client/JsonStringEnumMemberConverter.cs diff --git a/ApiClient.Tests/Api/CallRoutingApiTest.cs b/ApiClient.Tests/Api/CallRoutingApiTest.cs index 04b2f21..969ef48 100644 --- a/ApiClient.Tests/Api/CallRoutingApiTest.cs +++ b/ApiClient.Tests/Api/CallRoutingApiTest.cs @@ -627,7 +627,7 @@ public void ShouldUrlDestinationWebhook() var expectedSipTrunkId = "60d345fd3a799ec"; var expectedValueType = "SIP"; var expectedConnectTimeout = 30; - var expectedRecordingType = CallRoutingRecordingType.Audio; + var expectedRecordingType = "AUDIO"; var expectedType = "ENDPOINT"; var expectedResponse = $@" @@ -688,7 +688,7 @@ void AssertCallRoutingEndpointDestinationResponse( Assert.AreEqual(expectedSipTrunkId, callRoutingSipEndpoint.SipTrunkId); Assert.AreEqual(expectedConnectTimeout, callRoutingEndpointDestinationResponse.ConnectTimeout); - Assert.AreEqual(expectedRecordingType, callRoutingEndpointDestinationResponse.Recording.RecordingType); + Assert.AreEqual(expectedRecordingType, GetEnumAttributeValue(callRoutingEndpointDestinationResponse.Recording.RecordingType)); } void AssertCallRoutingUrlDestinationHttpRequest( diff --git a/ApiClient.Tests/Api/NumberMaskingApiTest.cs b/ApiClient.Tests/Api/NumberMaskingApiTest.cs index 14dc55a..3b78d4f 100644 --- a/ApiClient.Tests/Api/NumberMaskingApiTest.cs +++ b/ApiClient.Tests/Api/NumberMaskingApiTest.cs @@ -409,7 +409,7 @@ public void ShouldNumberMaskingStatusApi() var givenCurrency = "7e8d64c0-6c72-4922-aa96-48728753c660"; var givenRecordingFileId = "EUR"; var givenRecordingCalleeAnnouncement = true; - var givenRecordingStatus = NumberMaskingRecordingStatus.Sftp; + var givenRecordingStatus = "SFTP"; var givenClientReferenceId = "7e8d64c0-6c72-4922-aa96-48728753c660"; var givenRequest = $@" @@ -460,7 +460,7 @@ void AssertNumberMaskingStatusRequest(NumberMaskingStatusRequest numberMaskingSt Assert.AreEqual(givenCurrency, numberMaskingStatusRequest.Currency); Assert.AreEqual(givenRecordingFileId, numberMaskingStatusRequest.RecordingFileId); Assert.AreEqual(givenRecordingCalleeAnnouncement, numberMaskingStatusRequest.RecordCalleeAnnouncement); - Assert.AreEqual(givenRecordingStatus, numberMaskingStatusRequest.RecordingStatus); + Assert.AreEqual(givenRecordingStatus, GetEnumAttributeValue(numberMaskingStatusRequest.RecordingStatus!)); Assert.AreEqual(givenClientReferenceId, numberMaskingStatusRequest.ClientReferenceId); } } diff --git a/ApiClient.Tests/Api/SmsApiTest.cs b/ApiClient.Tests/Api/SmsApiTest.cs index ce323e9..8d4d84c 100644 --- a/ApiClient.Tests/Api/SmsApiTest.cs +++ b/ApiClient.Tests/Api/SmsApiTest.cs @@ -1558,12 +1558,12 @@ public void ShouldReceiveOutBoundSmsMessageReport() var givenPricePerMessage = 0.01m; var givenCurrency = "EUR"; var givenStatusGroupId = 3; - var givenStatusGroupName = MessageGeneralStatus.Delivered; + var givenStatusGroupName = "DELIVERED"; var givenStatusId = 5; var givenStatusName = "DELIVERED_TO_HANDSET"; var givenStatusDescription = "Message delivered to handset"; var givenErrorGroupId = 0; - var givenErrorGroupName = MessageErrorGroup.Ok; + var givenErrorGroupName = "USER_ERRORS"; var givenErrorId = 0; var givenErrorName = "NO_ERROR"; var givenErrorDescription = "No Error"; @@ -1582,12 +1582,12 @@ public void ShouldReceiveOutBoundSmsMessageReport() var givenSecondPricePerMessage = 0.01m; var givenSecondCurrency = "EUR"; var givenSecondStatusGroupId = 3; - var givenSecondStatusGroupName = MessageGeneralStatus.Delivered; + var givenSecondStatusGroupName = "DELIVERED"; var givenSecondStatusId = 5; var givenSecondStatusName = "DELIVERED_TO_HANDSET"; var givenSecondStatusDescription = "Message delivered to handset"; var givenSecondErrorGroupId = 0; - var givenSecondErrorGroupName = MessageErrorGroup.Ok; + var givenSecondErrorGroupName = "HANDSET_ERRORS"; var givenSecondErrorId = 0; var givenSecondErrorName = "NO_ERROR"; var givenSecondErrorDescription = "No Error"; @@ -1691,13 +1691,13 @@ void AssertSmsDeliveryResult(SmsDeliveryResult smsDeliveryResult) Assert.AreEqual(givenCurrency, smsDeliveryReport.Price.Currency); Assert.AreEqual(givenStatusGroupId, smsDeliveryReport.Status.GroupId); - Assert.AreEqual(givenStatusGroupName, smsDeliveryReport.Status.GroupName); + Assert.AreEqual(givenStatusGroupName, GetEnumAttributeValue(smsDeliveryReport.Status.GroupName!)); Assert.AreEqual(givenStatusId, smsDeliveryReport.Status.Id); Assert.AreEqual(givenStatusName, smsDeliveryReport.Status.Name); Assert.AreEqual(givenStatusDescription, smsDeliveryReport.Status.Description); Assert.AreEqual(givenErrorGroupId, smsDeliveryReport.Error.GroupId); - Assert.AreEqual(givenErrorGroupName, smsDeliveryReport.Error.GroupName); + Assert.AreEqual(givenErrorGroupName, GetEnumAttributeValue(smsDeliveryReport.Error.GroupName!)); Assert.AreEqual(givenErrorId, smsDeliveryReport.Error.Id); Assert.AreEqual(givenErrorName, smsDeliveryReport.Error.Name); Assert.AreEqual(givenErrorDescription, smsDeliveryReport.Error.Description); @@ -1720,13 +1720,13 @@ void AssertSmsDeliveryResult(SmsDeliveryResult smsDeliveryResult) Assert.AreEqual(givenSecondCurrency, smsSecondDeliveryReport.Price.Currency); Assert.AreEqual(givenSecondStatusGroupId, smsSecondDeliveryReport.Status.GroupId); - Assert.AreEqual(givenSecondStatusGroupName, smsSecondDeliveryReport.Status.GroupName); + Assert.AreEqual(givenSecondStatusGroupName, GetEnumAttributeValue(smsSecondDeliveryReport.Status.GroupName!)); Assert.AreEqual(givenSecondStatusId, smsSecondDeliveryReport.Status.Id); Assert.AreEqual(givenSecondStatusName, smsSecondDeliveryReport.Status.Name); Assert.AreEqual(givenSecondStatusDescription, smsSecondDeliveryReport.Status.Description); Assert.AreEqual(givenSecondErrorGroupId, smsSecondDeliveryReport.Error.GroupId); - Assert.AreEqual(givenSecondErrorGroupName, smsSecondDeliveryReport.Error.GroupName); + Assert.AreEqual(givenSecondErrorGroupName, GetEnumAttributeValue(smsSecondDeliveryReport.Error.GroupName!)); Assert.AreEqual(givenSecondErrorId, smsSecondDeliveryReport.Error.Id); Assert.AreEqual(givenSecondErrorName, smsSecondDeliveryReport.Error.Name); Assert.AreEqual(givenSecondErrorDescription, smsSecondDeliveryReport.Error.Description); diff --git a/CHANGELOG.md b/CHANGELOG.md index f008995..796a3c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to the library will be documented in this file. The format of the file is based on [Keep a Changelog](http://keepachangelog.com/) and this library adheres to [Semantic Versioning](http://semver.org/) as mentioned in [README.md][readme] file. +## [ [4.0.2](https://github.com/infobip/infobip-api-csharp-client/releases/tag/v4.0.2) ] - 2025-12-08 + +### Added +- Custom Enum Converter for System.Text.Json (see ###fixed for more information) + +### Fixed +- Enum deserialization using System.Text.Json now correctly maps Json string values to enums using values defined by [EnumMember] + ## [ [4.0.1](https://github.com/infobip/infobip-api-csharp-client/releases/tag/v4.0.1) ] - 2025-12-03 ### Changed diff --git a/README.md b/README.md index 111fd6e..a54e8fb 100644 --- a/README.md +++ b/README.md @@ -37,17 +37,17 @@ Within Visual Studio, use the Package Manager UI to browse for `Infobip.Api.Clie #### Package Manager Console Alternatively, also within Visual Studio, use the Package Manager Console command: - Install-Package Infobip.Api.Client -Version 4.0.1 + Install-Package Infobip.Api.Client -Version 4.0.2 #### .NET CLI If you are used to .NET CLI, the following command is going to be sufficient for you: - dotnet add package Infobip.Api.Client --version 4.0.1 + dotnet add package Infobip.Api.Client --version 4.0.2 ### Package reference Including the package directly into project file is also valid option. - + ## Quickstart diff --git a/src/Infobip.Api.Client/Client/Configuration.cs b/src/Infobip.Api.Client/Client/Configuration.cs index 0e1d424..ef65030 100644 --- a/src/Infobip.Api.Client/Client/Configuration.cs +++ b/src/Infobip.Api.Client/Client/Configuration.cs @@ -41,7 +41,7 @@ public class Configuration : IReadableConfiguration /// Version of the package. /// /// Version of the package. - public const string Version = "4.0.1"; + public const string Version = "4.0.2"; private string _dateTimeFormat = Iso8601DateTimeFormat; @@ -54,7 +54,7 @@ public class Configuration : IReadableConfiguration public Configuration() { Proxy = null; - UserAgent = "infobip-api-client-csharp/4.0.1"; + UserAgent = "infobip-api-client-csharp/4.0.2"; BasePath = "http://localhost"; DefaultHeaders = new ConcurrentDictionary(); diff --git a/src/Infobip.Api.Client/Client/JsonStringEnumMemberConverter.cs b/src/Infobip.Api.Client/Client/JsonStringEnumMemberConverter.cs new file mode 100644 index 0000000..ea6ac09 --- /dev/null +++ b/src/Infobip.Api.Client/Client/JsonStringEnumMemberConverter.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Infobip.Api.Client +{ + public class JsonStringEnumMemberConverter : JsonConverter where T : struct, Enum + { + private readonly Dictionary _fromValue; + private readonly Dictionary _toValue; + + public JsonStringEnumMemberConverter() + { + _fromValue = new Dictionary(StringComparer.OrdinalIgnoreCase); + _toValue = new Dictionary(); + foreach (var field in typeof(T).GetFields(BindingFlags.Public | BindingFlags.Static)) + { + var enumValue = (T)field.GetValue(null); + var enumMemberAttr = field.GetCustomAttribute(); + var strValue = enumMemberAttr?.Value ?? field.Name; + _fromValue[strValue] = enumValue; + _toValue[enumValue] = strValue; + } + } + + public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.String) + { + var enumString = reader.GetString(); + if (_fromValue.TryGetValue(enumString, out var value)) + return value; + throw new JsonException($"Unknown value '{enumString}' for enum '{typeof(T).Name}'"); + } + throw new JsonException($"Unexpected token parsing enum. Expected String, got {reader.TokenType}."); + } + + public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options) + { + if (_toValue.TryGetValue(value, out var stringValue)) + writer.WriteStringValue(stringValue); + else + writer.WriteStringValue(value.ToString()); + } + } +} \ No newline at end of file diff --git a/src/Infobip.Api.Client/Infobip.Api.Client.csproj b/src/Infobip.Api.Client/Infobip.Api.Client.csproj index 8132903..db9cd29 100644 --- a/src/Infobip.Api.Client/Infobip.Api.Client.csproj +++ b/src/Infobip.Api.Client/Infobip.Api.Client.csproj @@ -12,9 +12,9 @@ C# library for consuming Infobip's API Copyright @ Infobip ltd. All rights reserved. Infobip.Api.Client - 4.0.1 - 4.0.1 - 4.0.1 + 4.0.2 + 4.0.2 + 4.0.2 bin\$(Configuration)\$(TargetFramework)\Infobip.Api.Client.xml MIT https://github.com/infobip/infobip-api-csharp-client.git diff --git a/src/Infobip.Api.Client/Model/CallDirection.cs b/src/Infobip.Api.Client/Model/CallDirection.cs index 91615f7..c9296bf 100644 --- a/src/Infobip.Api.Client/Model/CallDirection.cs +++ b/src/Infobip.Api.Client/Model/CallDirection.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Call direction. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallDirection { /// diff --git a/src/Infobip.Api.Client/Model/CallEndpointType.cs b/src/Infobip.Api.Client/Model/CallEndpointType.cs index d76ea29..8cf81d6 100644 --- a/src/Infobip.Api.Client/Model/CallEndpointType.cs +++ b/src/Infobip.Api.Client/Model/CallEndpointType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -20,7 +19,7 @@ namespace Infobip.Api.Client.Model /// Defines CallEndpointType. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallEndpointType { /// diff --git a/src/Infobip.Api.Client/Model/CallRoutingCriteriaType.cs b/src/Infobip.Api.Client/Model/CallRoutingCriteriaType.cs index 5863682..5dce07d 100644 --- a/src/Infobip.Api.Client/Model/CallRoutingCriteriaType.cs +++ b/src/Infobip.Api.Client/Model/CallRoutingCriteriaType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -20,7 +19,7 @@ namespace Infobip.Api.Client.Model /// Defines CallRoutingCriteriaType. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallRoutingCriteriaType { /// diff --git a/src/Infobip.Api.Client/Model/CallRoutingDestinationType.cs b/src/Infobip.Api.Client/Model/CallRoutingDestinationType.cs index b67427f..2ce4aeb 100644 --- a/src/Infobip.Api.Client/Model/CallRoutingDestinationType.cs +++ b/src/Infobip.Api.Client/Model/CallRoutingDestinationType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -20,7 +19,7 @@ namespace Infobip.Api.Client.Model /// Defines CallRoutingDestinationType. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallRoutingDestinationType { /// diff --git a/src/Infobip.Api.Client/Model/CallRoutingEndpointType.cs b/src/Infobip.Api.Client/Model/CallRoutingEndpointType.cs index 50561e6..bc6eea4 100644 --- a/src/Infobip.Api.Client/Model/CallRoutingEndpointType.cs +++ b/src/Infobip.Api.Client/Model/CallRoutingEndpointType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -20,7 +19,7 @@ namespace Infobip.Api.Client.Model /// Defines CallRoutingEndpointType. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallRoutingEndpointType { /// diff --git a/src/Infobip.Api.Client/Model/CallRoutingRecordingType.cs b/src/Infobip.Api.Client/Model/CallRoutingRecordingType.cs index 52e3903..8feabb1 100644 --- a/src/Infobip.Api.Client/Model/CallRoutingRecordingType.cs +++ b/src/Infobip.Api.Client/Model/CallRoutingRecordingType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Recording type. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallRoutingRecordingType { /// diff --git a/src/Infobip.Api.Client/Model/CallState.cs b/src/Infobip.Api.Client/Model/CallState.cs index 9641a9e..97d7662 100644 --- a/src/Infobip.Api.Client/Model/CallState.cs +++ b/src/Infobip.Api.Client/Model/CallState.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Call state. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallState { /// diff --git a/src/Infobip.Api.Client/Model/CallVoice.cs b/src/Infobip.Api.Client/Model/CallVoice.cs index 402a74e..f190ce7 100644 --- a/src/Infobip.Api.Client/Model/CallVoice.cs +++ b/src/Infobip.Api.Client/Model/CallVoice.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -25,7 +24,7 @@ namespace Infobip.Api.Client.Model /// [here](https://www.infobip.com/docs/voice-and-video/getting-started#text-to-speech). /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallVoice { /// diff --git a/src/Infobip.Api.Client/Model/CallsActionStatus.cs b/src/Infobip.Api.Client/Model/CallsActionStatus.cs index 4cb5e14..1437db7 100644 --- a/src/Infobip.Api.Client/Model/CallsActionStatus.cs +++ b/src/Infobip.Api.Client/Model/CallsActionStatus.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Action status. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsActionStatus { /// diff --git a/src/Infobip.Api.Client/Model/CallsAnonymizationType.cs b/src/Infobip.Api.Client/Model/CallsAnonymizationType.cs index 9fd695a..69c27d6 100644 --- a/src/Infobip.Api.Client/Model/CallsAnonymizationType.cs +++ b/src/Infobip.Api.Client/Model/CallsAnonymizationType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Preferred presentation of anonymized calls. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsAnonymizationType { /// diff --git a/src/Infobip.Api.Client/Model/CallsAudioCodec.cs b/src/Infobip.Api.Client/Model/CallsAudioCodec.cs index 3bdf4bc..58cf9f5 100644 --- a/src/Infobip.Api.Client/Model/CallsAudioCodec.cs +++ b/src/Infobip.Api.Client/Model/CallsAudioCodec.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Audio codec. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsAudioCodec { /// diff --git a/src/Infobip.Api.Client/Model/CallsBillingPackageType.cs b/src/Infobip.Api.Client/Model/CallsBillingPackageType.cs index f9175a7..98c162f 100644 --- a/src/Infobip.Api.Client/Model/CallsBillingPackageType.cs +++ b/src/Infobip.Api.Client/Model/CallsBillingPackageType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Billing package type. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsBillingPackageType { /// diff --git a/src/Infobip.Api.Client/Model/CallsBulkEndpointType.cs b/src/Infobip.Api.Client/Model/CallsBulkEndpointType.cs index 0ea8e00..62a3719 100644 --- a/src/Infobip.Api.Client/Model/CallsBulkEndpointType.cs +++ b/src/Infobip.Api.Client/Model/CallsBulkEndpointType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -20,7 +19,7 @@ namespace Infobip.Api.Client.Model /// Defines CallsBulkEndpointType. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsBulkEndpointType { /// diff --git a/src/Infobip.Api.Client/Model/CallsBulkStatus.cs b/src/Infobip.Api.Client/Model/CallsBulkStatus.cs index c0345f7..5be3a11 100644 --- a/src/Infobip.Api.Client/Model/CallsBulkStatus.cs +++ b/src/Infobip.Api.Client/Model/CallsBulkStatus.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// New status of the bulk. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsBulkStatus { /// diff --git a/src/Infobip.Api.Client/Model/CallsCreationMethod.cs b/src/Infobip.Api.Client/Model/CallsCreationMethod.cs index 696d7b7..88ca4a2 100644 --- a/src/Infobip.Api.Client/Model/CallsCreationMethod.cs +++ b/src/Infobip.Api.Client/Model/CallsCreationMethod.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// File creation method. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsCreationMethod { /// diff --git a/src/Infobip.Api.Client/Model/CallsDetectionResult.cs b/src/Infobip.Api.Client/Model/CallsDetectionResult.cs index 8de1bf0..64f2f7a 100644 --- a/src/Infobip.Api.Client/Model/CallsDetectionResult.cs +++ b/src/Infobip.Api.Client/Model/CallsDetectionResult.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Detected entity that answered the call. `UNKNOWN` if unable to detect. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsDetectionResult { /// diff --git a/src/Infobip.Api.Client/Model/CallsDialogState.cs b/src/Infobip.Api.Client/Model/CallsDialogState.cs index 1998add..9d309fd 100644 --- a/src/Infobip.Api.Client/Model/CallsDialogState.cs +++ b/src/Infobip.Api.Client/Model/CallsDialogState.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Dialog state. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsDialogState { /// diff --git a/src/Infobip.Api.Client/Model/CallsDtmfType.cs b/src/Infobip.Api.Client/Model/CallsDtmfType.cs index 0c547ae..38c1b6f 100644 --- a/src/Infobip.Api.Client/Model/CallsDtmfType.cs +++ b/src/Infobip.Api.Client/Model/CallsDtmfType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// DTMF type. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsDtmfType { /// diff --git a/src/Infobip.Api.Client/Model/CallsErrorCode.cs b/src/Infobip.Api.Client/Model/CallsErrorCode.cs index e23a9c9..e969c99 100644 --- a/src/Infobip.Api.Client/Model/CallsErrorCode.cs +++ b/src/Infobip.Api.Client/Model/CallsErrorCode.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -35,7 +34,7 @@ namespace Infobip.Api.Client.Model /// established. `SERVICE_UNAVAILABLE` - Call cannot be established. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsErrorCode { /// diff --git a/src/Infobip.Api.Client/Model/CallsFaxType.cs b/src/Infobip.Api.Client/Model/CallsFaxType.cs index cc721d3..73e2d21 100644 --- a/src/Infobip.Api.Client/Model/CallsFaxType.cs +++ b/src/Infobip.Api.Client/Model/CallsFaxType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Fax type. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsFaxType { /// diff --git a/src/Infobip.Api.Client/Model/CallsFileFormat.cs b/src/Infobip.Api.Client/Model/CallsFileFormat.cs index bf3ce68..c204045 100644 --- a/src/Infobip.Api.Client/Model/CallsFileFormat.cs +++ b/src/Infobip.Api.Client/Model/CallsFileFormat.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// File format. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsFileFormat { /// diff --git a/src/Infobip.Api.Client/Model/CallsGender.cs b/src/Infobip.Api.Client/Model/CallsGender.cs index 506bbd4..08962ad 100644 --- a/src/Infobip.Api.Client/Model/CallsGender.cs +++ b/src/Infobip.Api.Client/Model/CallsGender.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Voice gender in which text would be synthesized. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsGender { /// diff --git a/src/Infobip.Api.Client/Model/CallsGenesysCloudRegion.cs b/src/Infobip.Api.Client/Model/CallsGenesysCloudRegion.cs index 1b34bb7..04a8a6f 100644 --- a/src/Infobip.Api.Client/Model/CallsGenesysCloudRegion.cs +++ b/src/Infobip.Api.Client/Model/CallsGenesysCloudRegion.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Genesys cloud region. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsGenesysCloudRegion { /// diff --git a/src/Infobip.Api.Client/Model/CallsHangupSource.cs b/src/Infobip.Api.Client/Model/CallsHangupSource.cs index 89e5de9..b6fdb00 100644 --- a/src/Infobip.Api.Client/Model/CallsHangupSource.cs +++ b/src/Infobip.Api.Client/Model/CallsHangupSource.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Hangup source. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsHangupSource { /// diff --git a/src/Infobip.Api.Client/Model/CallsIpCoreGeneralStatus.cs b/src/Infobip.Api.Client/Model/CallsIpCoreGeneralStatus.cs index 24f59c6..e7de13e 100644 --- a/src/Infobip.Api.Client/Model/CallsIpCoreGeneralStatus.cs +++ b/src/Infobip.Api.Client/Model/CallsIpCoreGeneralStatus.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -20,7 +19,7 @@ namespace Infobip.Api.Client.Model /// Defines CallsIpCoreGeneralStatus. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsIpCoreGeneralStatus { /// diff --git a/src/Infobip.Api.Client/Model/CallsLanguage.cs b/src/Infobip.Api.Client/Model/CallsLanguage.cs index e0abe9f..7017277 100644 --- a/src/Infobip.Api.Client/Model/CallsLanguage.cs +++ b/src/Infobip.Api.Client/Model/CallsLanguage.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -27,7 +26,7 @@ namespace Infobip.Api.Client.Model /// [documentation](https://www.infobip.com/docs/voice-and-video/outbound-calls#text-to-speech-voice-over-broadcast). /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsLanguage { /// diff --git a/src/Infobip.Api.Client/Model/CallsNumberPresentationFormat.cs b/src/Infobip.Api.Client/Model/CallsNumberPresentationFormat.cs index cb4012a..03f17d1 100644 --- a/src/Infobip.Api.Client/Model/CallsNumberPresentationFormat.cs +++ b/src/Infobip.Api.Client/Model/CallsNumberPresentationFormat.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Format in which numbers are sent to a SIP trunk. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsNumberPresentationFormat { /// diff --git a/src/Infobip.Api.Client/Model/CallsParticipantState.cs b/src/Infobip.Api.Client/Model/CallsParticipantState.cs index d4baf23..8f1bf11 100644 --- a/src/Infobip.Api.Client/Model/CallsParticipantState.cs +++ b/src/Infobip.Api.Client/Model/CallsParticipantState.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Participant state. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsParticipantState { /// diff --git a/src/Infobip.Api.Client/Model/CallsPlayContentType.cs b/src/Infobip.Api.Client/Model/CallsPlayContentType.cs index babb046..2b54231 100644 --- a/src/Infobip.Api.Client/Model/CallsPlayContentType.cs +++ b/src/Infobip.Api.Client/Model/CallsPlayContentType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -20,7 +19,7 @@ namespace Infobip.Api.Client.Model /// Defines CallsPlayContentType. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsPlayContentType { /// diff --git a/src/Infobip.Api.Client/Model/CallsProviderTrunkType.cs b/src/Infobip.Api.Client/Model/CallsProviderTrunkType.cs index 4c6506e..d876d24 100644 --- a/src/Infobip.Api.Client/Model/CallsProviderTrunkType.cs +++ b/src/Infobip.Api.Client/Model/CallsProviderTrunkType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Provider type. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsProviderTrunkType { /// diff --git a/src/Infobip.Api.Client/Model/CallsRecordingFileLocation.cs b/src/Infobip.Api.Client/Model/CallsRecordingFileLocation.cs index 8e339db..e5b5461 100644 --- a/src/Infobip.Api.Client/Model/CallsRecordingFileLocation.cs +++ b/src/Infobip.Api.Client/Model/CallsRecordingFileLocation.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Location of recording file after processing. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsRecordingFileLocation { /// diff --git a/src/Infobip.Api.Client/Model/CallsRecordingLocation.cs b/src/Infobip.Api.Client/Model/CallsRecordingLocation.cs index 041e5d4..93cf344 100644 --- a/src/Infobip.Api.Client/Model/CallsRecordingLocation.cs +++ b/src/Infobip.Api.Client/Model/CallsRecordingLocation.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -20,7 +19,7 @@ namespace Infobip.Api.Client.Model /// Defines CallsRecordingLocation. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsRecordingLocation { /// diff --git a/src/Infobip.Api.Client/Model/CallsRecordingStatus.cs b/src/Infobip.Api.Client/Model/CallsRecordingStatus.cs index 733212c..9239ba0 100644 --- a/src/Infobip.Api.Client/Model/CallsRecordingStatus.cs +++ b/src/Infobip.Api.Client/Model/CallsRecordingStatus.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Status of call recording. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsRecordingStatus { /// diff --git a/src/Infobip.Api.Client/Model/CallsRecordingType.cs b/src/Infobip.Api.Client/Model/CallsRecordingType.cs index 260e41e..bd60127 100644 --- a/src/Infobip.Api.Client/Model/CallsRecordingType.cs +++ b/src/Infobip.Api.Client/Model/CallsRecordingType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Recording type. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsRecordingType { /// diff --git a/src/Infobip.Api.Client/Model/CallsRequestMediaStreamConfigType.cs b/src/Infobip.Api.Client/Model/CallsRequestMediaStreamConfigType.cs index 4bd2824..09395e9 100644 --- a/src/Infobip.Api.Client/Model/CallsRequestMediaStreamConfigType.cs +++ b/src/Infobip.Api.Client/Model/CallsRequestMediaStreamConfigType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Media stream configuration type. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsRequestMediaStreamConfigType { /// diff --git a/src/Infobip.Api.Client/Model/CallsResponseMediaStreamConfigType.cs b/src/Infobip.Api.Client/Model/CallsResponseMediaStreamConfigType.cs index b393be4..747e6f1 100644 --- a/src/Infobip.Api.Client/Model/CallsResponseMediaStreamConfigType.cs +++ b/src/Infobip.Api.Client/Model/CallsResponseMediaStreamConfigType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Media stream configuration type. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsResponseMediaStreamConfigType { /// diff --git a/src/Infobip.Api.Client/Model/CallsSelectionStrategy.cs b/src/Infobip.Api.Client/Model/CallsSelectionStrategy.cs index 14e6b65..564cacd 100644 --- a/src/Infobip.Api.Client/Model/CallsSelectionStrategy.cs +++ b/src/Infobip.Api.Client/Model/CallsSelectionStrategy.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Strategy for SIP trunk host selection. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsSelectionStrategy { /// diff --git a/src/Infobip.Api.Client/Model/CallsSftpUploadStatus.cs b/src/Infobip.Api.Client/Model/CallsSftpUploadStatus.cs index f2f3fe4..0c94adb 100644 --- a/src/Infobip.Api.Client/Model/CallsSftpUploadStatus.cs +++ b/src/Infobip.Api.Client/Model/CallsSftpUploadStatus.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Indicates current status of the recording file being uploaded via SFTP. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsSftpUploadStatus { /// diff --git a/src/Infobip.Api.Client/Model/CallsSipTrunkActionStatus.cs b/src/Infobip.Api.Client/Model/CallsSipTrunkActionStatus.cs index 02352cc..032dd0b 100644 --- a/src/Infobip.Api.Client/Model/CallsSipTrunkActionStatus.cs +++ b/src/Infobip.Api.Client/Model/CallsSipTrunkActionStatus.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Status of the last action performed on the SIP trunk configuration. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsSipTrunkActionStatus { /// diff --git a/src/Infobip.Api.Client/Model/CallsSipTrunkAdminStatus.cs b/src/Infobip.Api.Client/Model/CallsSipTrunkAdminStatus.cs index 6b3309d..d6ee0ce 100644 --- a/src/Infobip.Api.Client/Model/CallsSipTrunkAdminStatus.cs +++ b/src/Infobip.Api.Client/Model/CallsSipTrunkAdminStatus.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// SIP trunk admin status. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsSipTrunkAdminStatus { /// diff --git a/src/Infobip.Api.Client/Model/CallsSipTrunkRegistrationStatus.cs b/src/Infobip.Api.Client/Model/CallsSipTrunkRegistrationStatus.cs index fbed81c..60cf027 100644 --- a/src/Infobip.Api.Client/Model/CallsSipTrunkRegistrationStatus.cs +++ b/src/Infobip.Api.Client/Model/CallsSipTrunkRegistrationStatus.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// SIP trunk registration status. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsSipTrunkRegistrationStatus { /// diff --git a/src/Infobip.Api.Client/Model/CallsSipTrunkType.cs b/src/Infobip.Api.Client/Model/CallsSipTrunkType.cs index 7d99db5..fa3ae12 100644 --- a/src/Infobip.Api.Client/Model/CallsSipTrunkType.cs +++ b/src/Infobip.Api.Client/Model/CallsSipTrunkType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// SIP trunk type. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsSipTrunkType { /// diff --git a/src/Infobip.Api.Client/Model/CallsStatus.cs b/src/Infobip.Api.Client/Model/CallsStatus.cs index 1733b31..05b013c 100644 --- a/src/Infobip.Api.Client/Model/CallsStatus.cs +++ b/src/Infobip.Api.Client/Model/CallsStatus.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Current bulk status. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsStatus { /// diff --git a/src/Infobip.Api.Client/Model/CallsTerminationType.cs b/src/Infobip.Api.Client/Model/CallsTerminationType.cs index 509eb10..bf806de 100644 --- a/src/Infobip.Api.Client/Model/CallsTerminationType.cs +++ b/src/Infobip.Api.Client/Model/CallsTerminationType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -20,7 +19,7 @@ namespace Infobip.Api.Client.Model /// Defines CallsTerminationType. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsTerminationType { /// diff --git a/src/Infobip.Api.Client/Model/CallsTimeUnit.cs b/src/Infobip.Api.Client/Model/CallsTimeUnit.cs index b7c5f9f..2132b2f 100644 --- a/src/Infobip.Api.Client/Model/CallsTimeUnit.cs +++ b/src/Infobip.Api.Client/Model/CallsTimeUnit.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Defines a time unit used for calculating call creation rate. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum CallsTimeUnit { /// diff --git a/src/Infobip.Api.Client/Model/CallsWebsocketEndpointConfigRequest.cs b/src/Infobip.Api.Client/Model/CallsWebsocketEndpointConfigRequest.cs index 5ce1713..f68074a 100644 --- a/src/Infobip.Api.Client/Model/CallsWebsocketEndpointConfigRequest.cs +++ b/src/Infobip.Api.Client/Model/CallsWebsocketEndpointConfigRequest.cs @@ -33,7 +33,7 @@ public class CallsWebsocketEndpointConfigRequest : CallsMediaStreamConfigRequest /// /// Audio sampling rate. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum SampleRateEnum { /// diff --git a/src/Infobip.Api.Client/Model/DeliveryDay.cs b/src/Infobip.Api.Client/Model/DeliveryDay.cs index aad6721..480f06f 100644 --- a/src/Infobip.Api.Client/Model/DeliveryDay.cs +++ b/src/Infobip.Api.Client/Model/DeliveryDay.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -25,7 +24,7 @@ namespace Infobip.Api.Client.Model /// multiple days with a comma. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum DeliveryDay { /// diff --git a/src/Infobip.Api.Client/Model/EmailAddSuppressionType.cs b/src/Infobip.Api.Client/Model/EmailAddSuppressionType.cs index 2ac35fa..50df005 100644 --- a/src/Infobip.Api.Client/Model/EmailAddSuppressionType.cs +++ b/src/Infobip.Api.Client/Model/EmailAddSuppressionType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Type of suppression. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum EmailAddSuppressionType { /// diff --git a/src/Infobip.Api.Client/Model/EmailBulkStatus.cs b/src/Infobip.Api.Client/Model/EmailBulkStatus.cs index 4d59fbb..202e546 100644 --- a/src/Infobip.Api.Client/Model/EmailBulkStatus.cs +++ b/src/Infobip.Api.Client/Model/EmailBulkStatus.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -20,7 +19,7 @@ namespace Infobip.Api.Client.Model /// Defines EmailBulkStatus. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum EmailBulkStatus { /// diff --git a/src/Infobip.Api.Client/Model/EmailDomainAccess.cs b/src/Infobip.Api.Client/Model/EmailDomainAccess.cs index 8baf790..39e5b99 100644 --- a/src/Infobip.Api.Client/Model/EmailDomainAccess.cs +++ b/src/Infobip.Api.Client/Model/EmailDomainAccess.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Represents the access level for the domain. Domain can be either owned or have granted permissions. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum EmailDomainAccess { /// diff --git a/src/Infobip.Api.Client/Model/EmailSuppressionType.cs b/src/Infobip.Api.Client/Model/EmailSuppressionType.cs index 8089f26..5d04bdb 100644 --- a/src/Infobip.Api.Client/Model/EmailSuppressionType.cs +++ b/src/Infobip.Api.Client/Model/EmailSuppressionType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Type of suppression. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum EmailSuppressionType { /// diff --git a/src/Infobip.Api.Client/Model/FlowAddFlowParticipantStatus.cs b/src/Infobip.Api.Client/Model/FlowAddFlowParticipantStatus.cs index 24a79de..a439c00 100644 --- a/src/Infobip.Api.Client/Model/FlowAddFlowParticipantStatus.cs +++ b/src/Infobip.Api.Client/Model/FlowAddFlowParticipantStatus.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Processing status of the participant. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum FlowAddFlowParticipantStatus { /// diff --git a/src/Infobip.Api.Client/Model/FlowErrorStatusReason.cs b/src/Infobip.Api.Client/Model/FlowErrorStatusReason.cs index ae0683e..c286f1f 100644 --- a/src/Infobip.Api.Client/Model/FlowErrorStatusReason.cs +++ b/src/Infobip.Api.Client/Model/FlowErrorStatusReason.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -37,7 +36,7 @@ namespace Infobip.Api.Client.Model /// contact your Account Manager. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum FlowErrorStatusReason { /// diff --git a/src/Infobip.Api.Client/Model/FlowGender.cs b/src/Infobip.Api.Client/Model/FlowGender.cs index 9fef98a..898fd1a 100644 --- a/src/Infobip.Api.Client/Model/FlowGender.cs +++ b/src/Infobip.Api.Client/Model/FlowGender.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Person's gender. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum FlowGender { /// diff --git a/src/Infobip.Api.Client/Model/FlowOrigin.cs b/src/Infobip.Api.Client/Model/FlowOrigin.cs index 64ea7cd..3bc3abb 100644 --- a/src/Infobip.Api.Client/Model/FlowOrigin.cs +++ b/src/Infobip.Api.Client/Model/FlowOrigin.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// The information which describes the source of the last modification of record. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum FlowOrigin { /// diff --git a/src/Infobip.Api.Client/Model/FlowPersonUniqueFieldType.cs b/src/Infobip.Api.Client/Model/FlowPersonUniqueFieldType.cs index 774e6fb..1d3e793 100644 --- a/src/Infobip.Api.Client/Model/FlowPersonUniqueFieldType.cs +++ b/src/Infobip.Api.Client/Model/FlowPersonUniqueFieldType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Type of unique ID [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum FlowPersonUniqueFieldType { /// diff --git a/src/Infobip.Api.Client/Model/FlowType.cs b/src/Infobip.Api.Client/Model/FlowType.cs index 946e7cc..da7b170 100644 --- a/src/Infobip.Api.Client/Model/FlowType.cs +++ b/src/Infobip.Api.Client/Model/FlowType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Person's type, default type is CUSTOMER. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum FlowType { /// diff --git a/src/Infobip.Api.Client/Model/FormsActionAfterSubmissionType.cs b/src/Infobip.Api.Client/Model/FormsActionAfterSubmissionType.cs index 1b4af71..485b77a 100644 --- a/src/Infobip.Api.Client/Model/FormsActionAfterSubmissionType.cs +++ b/src/Infobip.Api.Client/Model/FormsActionAfterSubmissionType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -20,7 +19,7 @@ namespace Infobip.Api.Client.Model /// Defines FormsActionAfterSubmissionType. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum FormsActionAfterSubmissionType { /// diff --git a/src/Infobip.Api.Client/Model/FormsComponentType.cs b/src/Infobip.Api.Client/Model/FormsComponentType.cs index b80b532..5be27d1 100644 --- a/src/Infobip.Api.Client/Model/FormsComponentType.cs +++ b/src/Infobip.Api.Client/Model/FormsComponentType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -20,7 +19,7 @@ namespace Infobip.Api.Client.Model /// Defines FormsComponentType. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum FormsComponentType { /// diff --git a/src/Infobip.Api.Client/Model/FormsStatus.cs b/src/Infobip.Api.Client/Model/FormsStatus.cs index 78a4522..748f85d 100644 --- a/src/Infobip.Api.Client/Model/FormsStatus.cs +++ b/src/Infobip.Api.Client/Model/FormsStatus.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Form status [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum FormsStatus { /// diff --git a/src/Infobip.Api.Client/Model/FormsType.cs b/src/Infobip.Api.Client/Model/FormsType.cs index 714a088..90e9ca4 100644 --- a/src/Infobip.Api.Client/Model/FormsType.cs +++ b/src/Infobip.Api.Client/Model/FormsType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Form type [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum FormsType { /// diff --git a/src/Infobip.Api.Client/Model/HmacAlgorithm.cs b/src/Infobip.Api.Client/Model/HmacAlgorithm.cs index bde124c..624e59e 100644 --- a/src/Infobip.Api.Client/Model/HmacAlgorithm.cs +++ b/src/Infobip.Api.Client/Model/HmacAlgorithm.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// HMAC algorithm. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum HmacAlgorithm { /// diff --git a/src/Infobip.Api.Client/Model/IysRecipientType.cs b/src/Infobip.Api.Client/Model/IysRecipientType.cs index 91bd126..e0b3b36 100644 --- a/src/Infobip.Api.Client/Model/IysRecipientType.cs +++ b/src/Infobip.Api.Client/Model/IysRecipientType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Recipient Type must be `TACIR` or `BIREYSEL`. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum IysRecipientType { /// diff --git a/src/Infobip.Api.Client/Model/MessageErrorGroup.cs b/src/Infobip.Api.Client/Model/MessageErrorGroup.cs index 02424ae..1ad07a6 100644 --- a/src/Infobip.Api.Client/Model/MessageErrorGroup.cs +++ b/src/Infobip.Api.Client/Model/MessageErrorGroup.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Error group name that describes which category the error code belongs to. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum MessageErrorGroup { /// diff --git a/src/Infobip.Api.Client/Model/MessageGeneralStatus.cs b/src/Infobip.Api.Client/Model/MessageGeneralStatus.cs index 4a6b8ba..da81009 100644 --- a/src/Infobip.Api.Client/Model/MessageGeneralStatus.cs +++ b/src/Infobip.Api.Client/Model/MessageGeneralStatus.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -33,7 +32,7 @@ namespace Infobip.Api.Client.Model /// [REJECTED](https://www.infobip.com/docs/essentials/response-status-and-error-codes#rejected-general-status-codes). /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum MessageGeneralStatus { /// diff --git a/src/Infobip.Api.Client/Model/NumberMaskingRecordingStatus.cs b/src/Infobip.Api.Client/Model/NumberMaskingRecordingStatus.cs index e1db0a9..a39a6b7 100644 --- a/src/Infobip.Api.Client/Model/NumberMaskingRecordingStatus.cs +++ b/src/Infobip.Api.Client/Model/NumberMaskingRecordingStatus.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Recording status provided if recording was attempted. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum NumberMaskingRecordingStatus { /// diff --git a/src/Infobip.Api.Client/Model/SecurityConfigType.cs b/src/Infobip.Api.Client/Model/SecurityConfigType.cs index 6bcc1a3..c5b0af0 100644 --- a/src/Infobip.Api.Client/Model/SecurityConfigType.cs +++ b/src/Infobip.Api.Client/Model/SecurityConfigType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -20,7 +19,7 @@ namespace Infobip.Api.Client.Model /// Defines SecurityConfigType. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum SecurityConfigType { /// diff --git a/src/Infobip.Api.Client/Model/SmsBulkStatus.cs b/src/Infobip.Api.Client/Model/SmsBulkStatus.cs index ee00290..4a9cf7a 100644 --- a/src/Infobip.Api.Client/Model/SmsBulkStatus.cs +++ b/src/Infobip.Api.Client/Model/SmsBulkStatus.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// The status of the message(s). [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum SmsBulkStatus { /// diff --git a/src/Infobip.Api.Client/Model/SmsLanguageCode.cs b/src/Infobip.Api.Client/Model/SmsLanguageCode.cs index eb771c5..4c3e721 100644 --- a/src/Infobip.Api.Client/Model/SmsLanguageCode.cs +++ b/src/Infobip.Api.Client/Model/SmsLanguageCode.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -27,7 +26,7 @@ namespace Infobip.Api.Client.Model /// message content. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum SmsLanguageCode { /// diff --git a/src/Infobip.Api.Client/Model/SmsTransliterationCode.cs b/src/Infobip.Api.Client/Model/SmsTransliterationCode.cs index 3245e6d..7fde1d6 100644 --- a/src/Infobip.Api.Client/Model/SmsTransliterationCode.cs +++ b/src/Infobip.Api.Client/Model/SmsTransliterationCode.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -30,7 +29,7 @@ namespace Infobip.Api.Client.Model /// `. /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum SmsTransliterationCode { /// diff --git a/src/Infobip.Api.Client/Model/SpeedLimitTimeUnit.cs b/src/Infobip.Api.Client/Model/SpeedLimitTimeUnit.cs index 50ebf36..a334e89 100644 --- a/src/Infobip.Api.Client/Model/SpeedLimitTimeUnit.cs +++ b/src/Infobip.Api.Client/Model/SpeedLimitTimeUnit.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// The time unit to define when setting a messaging speed limit. Defaults to `MINUTE`. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum SpeedLimitTimeUnit { /// diff --git a/src/Infobip.Api.Client/Model/TfaLanguage.cs b/src/Infobip.Api.Client/Model/TfaLanguage.cs index 8f85dce..fb81551 100644 --- a/src/Infobip.Api.Client/Model/TfaLanguage.cs +++ b/src/Infobip.Api.Client/Model/TfaLanguage.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -25,7 +24,7 @@ namespace Infobip.Api.Client.Model /// default to English (`en`). /// [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum TfaLanguage { /// diff --git a/src/Infobip.Api.Client/Model/TfaPinType.cs b/src/Infobip.Api.Client/Model/TfaPinType.cs index 99c81f7..a71123f 100644 --- a/src/Infobip.Api.Client/Model/TfaPinType.cs +++ b/src/Infobip.Api.Client/Model/TfaPinType.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Type of PIN code that will be generated and sent as part of 2FA message. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum TfaPinType { /// diff --git a/src/Infobip.Api.Client/Model/ValidityPeriodTimeUnit.cs b/src/Infobip.Api.Client/Model/ValidityPeriodTimeUnit.cs index 3bec4f6..7425fe2 100644 --- a/src/Infobip.Api.Client/Model/ValidityPeriodTimeUnit.cs +++ b/src/Infobip.Api.Client/Model/ValidityPeriodTimeUnit.cs @@ -10,7 +10,6 @@ using System.Runtime.Serialization; -using System.Text.Json.Serialization; using Newtonsoft.Json.Converters; using JsonConverterAttribute = Newtonsoft.Json.JsonConverterAttribute; @@ -21,7 +20,7 @@ namespace Infobip.Api.Client.Model /// /// Message validity period time unit. [JsonConverter(typeof(StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum ValidityPeriodTimeUnit { ///