diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4512188..2622add 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 7.0.404 + dotnet-version: 8.x - name: Install tools run: | @@ -37,7 +37,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 7.0.404 + dotnet-version: 8.x - name: Publish env: diff --git a/src/Mercoa.Client.sln b/src/Mercoa.Client.sln index 289960a..49be81b 100644 --- a/src/Mercoa.Client.sln +++ b/src/Mercoa.Client.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mercoa.Client", "Mercoa.Client\Mercoa.Client.csproj", "{4E9723B5-0D4E-4C47-876C-2496478B955E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mercoa.Client", "Mercoa.Client\Mercoa.Client.csproj", "{EC873A1C-C5D6-4DA8-A16E-72350EFA4E82}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mercoa.Client.Test", "Mercoa.Client.Test\Mercoa.Client.Test.csproj", "{730ABA81-798E-4B9B-91C2-F4956628D257}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mercoa.Client.Test", "Mercoa.Client.Test\Mercoa.Client.Test.csproj", "{57C6771A-DF68-48BA-B583-99AA311726B1}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -16,13 +16,13 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4E9723B5-0D4E-4C47-876C-2496478B955E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4E9723B5-0D4E-4C47-876C-2496478B955E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4E9723B5-0D4E-4C47-876C-2496478B955E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4E9723B5-0D4E-4C47-876C-2496478B955E}.Release|Any CPU.Build.0 = Release|Any CPU - {730ABA81-798E-4B9B-91C2-F4956628D257}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {730ABA81-798E-4B9B-91C2-F4956628D257}.Debug|Any CPU.Build.0 = Debug|Any CPU - {730ABA81-798E-4B9B-91C2-F4956628D257}.Release|Any CPU.ActiveCfg = Release|Any CPU - {730ABA81-798E-4B9B-91C2-F4956628D257}.Release|Any CPU.Build.0 = Release|Any CPU + {EC873A1C-C5D6-4DA8-A16E-72350EFA4E82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EC873A1C-C5D6-4DA8-A16E-72350EFA4E82}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EC873A1C-C5D6-4DA8-A16E-72350EFA4E82}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EC873A1C-C5D6-4DA8-A16E-72350EFA4E82}.Release|Any CPU.Build.0 = Release|Any CPU + {57C6771A-DF68-48BA-B583-99AA311726B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {57C6771A-DF68-48BA-B583-99AA311726B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {57C6771A-DF68-48BA-B583-99AA311726B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {57C6771A-DF68-48BA-B583-99AA311726B1}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/src/Mercoa.Client/BankLookup/BankLookupClient.cs b/src/Mercoa.Client/BankLookup/BankLookupClient.cs index 9d79e3c..ffdc5b2 100644 --- a/src/Mercoa.Client/BankLookup/BankLookupClient.cs +++ b/src/Mercoa.Client/BankLookup/BankLookupClient.cs @@ -1,6 +1,8 @@ using System.Text.Json; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class BankLookupClient @@ -34,6 +36,6 @@ public async Task FindAsync(BankLookupRequest request) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } } diff --git a/src/Mercoa.Client/BankLookup/requests/BankLookupRequest.cs b/src/Mercoa.Client/BankLookup/Requests/BankLookupRequest.cs similarity index 100% rename from src/Mercoa.Client/BankLookup/requests/BankLookupRequest.cs rename to src/Mercoa.Client/BankLookup/Requests/BankLookupRequest.cs diff --git a/src/Mercoa.Client/BankLookup/Types/BankAddress.cs b/src/Mercoa.Client/BankLookup/Types/BankAddress.cs index ef632ff..b50016f 100644 --- a/src/Mercoa.Client/BankLookup/Types/BankAddress.cs +++ b/src/Mercoa.Client/BankLookup/Types/BankAddress.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class BankAddress diff --git a/src/Mercoa.Client/BankLookup/Types/BankLookupResponse.cs b/src/Mercoa.Client/BankLookup/Types/BankLookupResponse.cs index 0f3facd..4b8b880 100644 --- a/src/Mercoa.Client/BankLookup/Types/BankLookupResponse.cs +++ b/src/Mercoa.Client/BankLookup/Types/BankLookupResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class BankLookupResponse diff --git a/src/Mercoa.Client/Commons/CommonsClient.cs b/src/Mercoa.Client/Commons/CommonsClient.cs index f84d69a..63810f5 100644 --- a/src/Mercoa.Client/Commons/CommonsClient.cs +++ b/src/Mercoa.Client/Commons/CommonsClient.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class CommonsClient diff --git a/src/Mercoa.Client/Commons/Types/Address.cs b/src/Mercoa.Client/Commons/Types/Address.cs index 65901b5..d813ca1 100644 --- a/src/Mercoa.Client/Commons/Types/Address.cs +++ b/src/Mercoa.Client/Commons/Types/Address.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class Address diff --git a/src/Mercoa.Client/Commons/Types/BirthDate.cs b/src/Mercoa.Client/Commons/Types/BirthDate.cs index bce3818..4203c66 100644 --- a/src/Mercoa.Client/Commons/Types/BirthDate.cs +++ b/src/Mercoa.Client/Commons/Types/BirthDate.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class BirthDate diff --git a/src/Mercoa.Client/Commons/Types/FullName.cs b/src/Mercoa.Client/Commons/Types/FullName.cs index 22de45a..414eb2e 100644 --- a/src/Mercoa.Client/Commons/Types/FullName.cs +++ b/src/Mercoa.Client/Commons/Types/FullName.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class FullName diff --git a/src/Mercoa.Client/Commons/Types/IndividualGovernmentId.cs b/src/Mercoa.Client/Commons/Types/IndividualGovernmentId.cs index 4f75a99..052a993 100644 --- a/src/Mercoa.Client/Commons/Types/IndividualGovernmentId.cs +++ b/src/Mercoa.Client/Commons/Types/IndividualGovernmentId.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class IndividualGovernmentId diff --git a/src/Mercoa.Client/Commons/Types/OrderDirection.cs b/src/Mercoa.Client/Commons/Types/OrderDirection.cs index 12694fd..17d7dcb 100644 --- a/src/Mercoa.Client/Commons/Types/OrderDirection.cs +++ b/src/Mercoa.Client/Commons/Types/OrderDirection.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum OrderDirection { [EnumMember(Value = "ASC")] diff --git a/src/Mercoa.Client/Commons/Types/PhoneNumber.cs b/src/Mercoa.Client/Commons/Types/PhoneNumber.cs index 1c50f04..e2796ec 100644 --- a/src/Mercoa.Client/Commons/Types/PhoneNumber.cs +++ b/src/Mercoa.Client/Commons/Types/PhoneNumber.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class PhoneNumber diff --git a/src/Mercoa.Client/Core/ClientOptions.cs b/src/Mercoa.Client/Core/ClientOptions.cs index 8fdba21..ab8280f 100644 --- a/src/Mercoa.Client/Core/ClientOptions.cs +++ b/src/Mercoa.Client/Core/ClientOptions.cs @@ -1,5 +1,7 @@ using Mercoa.Client.Core; +#nullable enable + namespace Mercoa.Client; public partial class ClientOptions diff --git a/src/Mercoa.Client/Core/CollectionItemSerializer.cs b/src/Mercoa.Client/Core/CollectionItemSerializer.cs new file mode 100644 index 0000000..bb41cc6 --- /dev/null +++ b/src/Mercoa.Client/Core/CollectionItemSerializer.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Mercoa.Client; + +/// +/// Json collection converter. +/// +/// Type of item to convert. +/// Converter to use for individual items. +public class CollectionItemSerializer + : JsonConverter> + where TConverterType : JsonConverter +{ + /// + /// Reads a json string and deserializes it into an object. + /// + /// Json reader. + /// Type to convert. + /// Serializer options. + /// Created object. + public override IEnumerable Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType == JsonTokenType.Null) + { + return default(IEnumerable); + } + + JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions(options); + jsonSerializerOptions.Converters.Clear(); + jsonSerializerOptions.Converters.Add(Activator.CreateInstance()); + + List returnValue = new List(); + + while (reader.TokenType != JsonTokenType.EndArray) + { + if (reader.TokenType != JsonTokenType.StartArray) + { + returnValue.Add( + (TDatatype) + JsonSerializer.Deserialize( + ref reader, + typeof(TDatatype), + jsonSerializerOptions + ) + ); + } + + reader.Read(); + } + + return returnValue; + } + + /// + /// Writes a json string. + /// + /// Json writer. + /// Value to write. + /// Serializer options. + public override void Write( + Utf8JsonWriter writer, + IEnumerable value, + JsonSerializerOptions options + ) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions(options); + jsonSerializerOptions.Converters.Clear(); + jsonSerializerOptions.Converters.Add(Activator.CreateInstance()); + + writer.WriteStartArray(); + + foreach (TDatatype data in value) + { + JsonSerializer.Serialize(writer, data, jsonSerializerOptions); + } + + writer.WriteEndArray(); + } +} diff --git a/src/Mercoa.Client/Core/JsonEnumMemberStringEnumConverter.cs b/src/Mercoa.Client/Core/JsonEnumMemberStringEnumConverter.cs deleted file mode 100644 index 2b521ee..0000000 --- a/src/Mercoa.Client/Core/JsonEnumMemberStringEnumConverter.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System.Reflection; -using System.Runtime.Serialization; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Mercoa.Client; - -#nullable enable - -/// -/// Handles serializing C# enums into the appropriate string values. -/// -public class JsonEnumMemberStringEnumConverter : JsonConverterFactory -{ - private readonly JsonNamingPolicy? _namingPolicy; - private readonly bool _allowIntegerValues; - private readonly JsonStringEnumConverter _baseConverter; - - public JsonEnumMemberStringEnumConverter( - JsonNamingPolicy? namingPolicy = null, - bool allowIntegerValues = true - ) - { - _namingPolicy = namingPolicy; - _allowIntegerValues = allowIntegerValues; - _baseConverter = new JsonStringEnumConverter(namingPolicy, allowIntegerValues); - } - - public override bool CanConvert(Type typeToConvert) => _baseConverter.CanConvert(typeToConvert); - - public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options) - { - var query = - from field in typeToConvert.GetFields(BindingFlags.Public | BindingFlags.Static) - let attr = field.GetCustomAttribute() - where attr != null && attr.Value != null - select (field.Name, attr.Value); - var dictionary = query.ToDictionary(p => p.Item1, p => p.Item2); - if (dictionary.Count > 0) - return new JsonStringEnumConverter( - new DictionaryLookupNamingPolicy(dictionary, _namingPolicy), - _allowIntegerValues - ).CreateConverter(typeToConvert, options); - else - return _baseConverter.CreateConverter(typeToConvert, options); - } -} - -public class JsonNamingPolicyDecorator : JsonNamingPolicy -{ - readonly JsonNamingPolicy? _underlyingNamingPolicy; - - protected JsonNamingPolicyDecorator(JsonNamingPolicy? underlyingNamingPolicy) - { - _underlyingNamingPolicy = underlyingNamingPolicy; - } - - public override string ConvertName(string name) => - _underlyingNamingPolicy?.ConvertName(name) ?? name; -} - -internal class DictionaryLookupNamingPolicy : JsonNamingPolicyDecorator -{ - readonly Dictionary dictionary; - - public DictionaryLookupNamingPolicy( - Dictionary dictionary, - JsonNamingPolicy? underlyingNamingPolicy - ) - : base(underlyingNamingPolicy) => - this.dictionary = dictionary ?? throw new ArgumentNullException(); - - public override string ConvertName(string name) => - dictionary.TryGetValue(name, out var value) ? value : base.ConvertName(name); -} diff --git a/src/Mercoa.Client/Core/OneOfSerializer.cs b/src/Mercoa.Client/Core/OneOfSerializer.cs new file mode 100644 index 0000000..874593b --- /dev/null +++ b/src/Mercoa.Client/Core/OneOfSerializer.cs @@ -0,0 +1,67 @@ +using System.Reflection; +using System.Text.Json; +using System.Text.Json.Serialization; +using OneOf; + +namespace Mercoa.Client; + +public class OneOfSerializer : JsonConverter + where TOneOf : IOneOf +{ + public override TOneOf Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType is JsonTokenType.Null) + return default; + + foreach (var (type, cast) in s_types) + { + try + { + Utf8JsonReader readerCopy = reader; + var result = JsonSerializer.Deserialize(ref readerCopy, type, options); + reader.Skip(); + return (TOneOf)cast.Invoke(null, new[] { result })!; + } + catch (JsonException) { } + } + + throw new JsonException( + $"Cannot deserialize into one of the supported types for {typeToConvert}" + ); + } + + private static readonly (Type type, MethodInfo cast)[] s_types = GetOneOfTypes(); + + public override void Write(Utf8JsonWriter writer, TOneOf value, JsonSerializerOptions options) + { + JsonSerializer.Serialize(writer, value.Value, options); + } + + private static (Type type, MethodInfo cast)[] GetOneOfTypes() + { + var casts = typeof(TOneOf) + .GetRuntimeMethods() + .Where(m => m.IsSpecialName && m.Name == "op_Implicit") + .ToArray(); + var type = typeof(TOneOf); + while (type != null) + { + if ( + type.IsGenericType + && (type.Name.StartsWith("OneOf`") || type.Name.StartsWith("OneOfBase`")) + ) + { + return type.GetGenericArguments() + .Select(t => (t, casts.First(c => c.GetParameters()[0].ParameterType == t))) + .ToArray(); + } + + type = type.BaseType; + } + throw new InvalidOperationException($"{typeof(TOneOf)} isn't OneOf or OneOfBase"); + } +} diff --git a/src/Mercoa.Client/Core/RawClient.cs b/src/Mercoa.Client/Core/RawClient.cs index 45f9d52..e9e67a8 100644 --- a/src/Mercoa.Client/Core/RawClient.cs +++ b/src/Mercoa.Client/Core/RawClient.cs @@ -49,12 +49,7 @@ public async Task MakeRequestAsync(ApiRequest request) // Add the request body to the request if (request.Body != null) { - var serializerOptions = new JsonSerializerOptions - { - Converters = { new JsonEnumMemberStringEnumConverter() }, - // Set other options as required: - WriteIndented = true, - }; + var serializerOptions = new JsonSerializerOptions { WriteIndented = true, }; httpRequest.Content = new StringContent( JsonSerializer.Serialize(request.Body, serializerOptions), Encoding.UTF8, diff --git a/src/Mercoa.Client/Core/StringEnumSerializer.cs b/src/Mercoa.Client/Core/StringEnumSerializer.cs new file mode 100644 index 0000000..d1eb074 --- /dev/null +++ b/src/Mercoa.Client/Core/StringEnumSerializer.cs @@ -0,0 +1,60 @@ +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Mercoa.Client; + +public class StringEnumSerializer : JsonConverter + where TEnum : struct, System.Enum +{ + private readonly Dictionary _enumToString = new Dictionary(); + private readonly Dictionary _stringToEnum = new Dictionary(); + + public StringEnumSerializer() + { + var type = typeof(TEnum); + var values = System.Enum.GetValues(); + + foreach (var value in values) + { + var enumMember = type.GetMember(value.ToString())[0]; + var attr = enumMember + .GetCustomAttributes(typeof(EnumMemberAttribute), false) + .Cast() + .FirstOrDefault(); + + _stringToEnum.Add(value.ToString(), value); + + if (attr?.Value != null) + { + _enumToString.Add(value, attr.Value); + _stringToEnum.Add(attr.Value, value); + } + else + { + _enumToString.Add(value, value.ToString()); + } + } + } + + public override TEnum Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = reader.GetString(); + + if (_stringToEnum.TryGetValue(stringValue, out var enumValue)) + { + return enumValue; + } + + return default; + } + + public override void Write(Utf8JsonWriter writer, TEnum value, JsonSerializerOptions options) + { + writer.WriteStringValue(_enumToString[value]); + } +} diff --git a/src/Mercoa.Client/CustomPaymentMethodSchema/CustomPaymentMethodSchemaClient.cs b/src/Mercoa.Client/CustomPaymentMethodSchema/CustomPaymentMethodSchemaClient.cs index e229e7b..2b8b58b 100644 --- a/src/Mercoa.Client/CustomPaymentMethodSchema/CustomPaymentMethodSchemaClient.cs +++ b/src/Mercoa.Client/CustomPaymentMethodSchema/CustomPaymentMethodSchemaClient.cs @@ -1,6 +1,8 @@ using System.Text.Json; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class CustomPaymentMethodSchemaClient @@ -15,7 +17,7 @@ public CustomPaymentMethodSchemaClient(RawClient client) /// /// Get all custom payment method schemas /// - public async Task> GetAllAsync() + public async Task> GetAllAsync() { var response = await _client.MakeRequestAsync( new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/schema" } @@ -23,11 +25,11 @@ public async Task> GetAllAsync() string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) { - return JsonSerializer.Deserialize>( + return JsonSerializer.Deserialize>( responseBody ); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -50,7 +52,7 @@ CustomPaymentMethodSchemaRequest request { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -74,7 +76,7 @@ CustomPaymentMethodSchemaRequest request { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -90,7 +92,7 @@ public async Task GetAsync(string schemaId) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// diff --git a/src/Mercoa.Client/EmailLogTypes/EmailLogTypesClient.cs b/src/Mercoa.Client/EmailLogTypes/EmailLogTypesClient.cs index f7f939b..0cd1d26 100644 --- a/src/Mercoa.Client/EmailLogTypes/EmailLogTypesClient.cs +++ b/src/Mercoa.Client/EmailLogTypes/EmailLogTypesClient.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class EmailLogTypesClient diff --git a/src/Mercoa.Client/EmailLogTypes/Types/EmailLog.cs b/src/Mercoa.Client/EmailLogTypes/Types/EmailLog.cs index d5e7b21..f5e2cb4 100644 --- a/src/Mercoa.Client/EmailLogTypes/Types/EmailLog.cs +++ b/src/Mercoa.Client/EmailLogTypes/Types/EmailLog.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class EmailLog diff --git a/src/Mercoa.Client/EmailLogTypes/Types/EmailLogResponse.cs b/src/Mercoa.Client/EmailLogTypes/Types/EmailLogResponse.cs index c98d018..6f7f1ae 100644 --- a/src/Mercoa.Client/EmailLogTypes/Types/EmailLogResponse.cs +++ b/src/Mercoa.Client/EmailLogTypes/Types/EmailLogResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class EmailLogResponse @@ -18,5 +20,5 @@ public class EmailLogResponse public bool HasMore { get; init; } [JsonPropertyName("data")] - public List Data { get; init; } + public IEnumerable Data { get; init; } } diff --git a/src/Mercoa.Client/Entity/ApprovalPolicy/ApprovalPolicyClient.cs b/src/Mercoa.Client/Entity/ApprovalPolicy/ApprovalPolicyClient.cs index 5474cca..44345dd 100644 --- a/src/Mercoa.Client/Entity/ApprovalPolicy/ApprovalPolicyClient.cs +++ b/src/Mercoa.Client/Entity/ApprovalPolicy/ApprovalPolicyClient.cs @@ -1,6 +1,8 @@ using System.Text.Json; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Entity; public class ApprovalPolicyClient @@ -15,7 +17,7 @@ public ApprovalPolicyClient(RawClient client) /// /// Retrieve all invoice approval policies associated with an entity /// - public async Task> GetAllAsync() + public async Task> GetAllAsync() { var response = await _client.MakeRequestAsync( new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/approval-policies" } @@ -23,9 +25,9 @@ public async Task> GetAllAsync() string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) { - return JsonSerializer.Deserialize>(responseBody); + return JsonSerializer.Deserialize>(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -46,7 +48,7 @@ public async Task CreateAsync(ApprovalPolicyRequest requ { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -66,7 +68,7 @@ public async Task GetAsync(string policyId) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -90,7 +92,7 @@ ApprovalPolicyUpdateRequest request { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// diff --git a/src/Mercoa.Client/Entity/Counterparty/CounterpartyClient.cs b/src/Mercoa.Client/Entity/Counterparty/CounterpartyClient.cs index b15503f..3cc326f 100644 --- a/src/Mercoa.Client/Entity/Counterparty/CounterpartyClient.cs +++ b/src/Mercoa.Client/Entity/Counterparty/CounterpartyClient.cs @@ -2,6 +2,8 @@ using Mercoa.Client; using Mercoa.Client.Entity; +#nullable enable + namespace Mercoa.Client.Entity; public class CounterpartyClient @@ -62,7 +64,7 @@ FindPayeeCounterpartiesRequest request { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -114,7 +116,7 @@ FindPayorCounterpartiesRequest request { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// diff --git a/src/Mercoa.Client/Entity/Counterparty/requests/FindPayeeCounterpartiesRequest.cs b/src/Mercoa.Client/Entity/Counterparty/Requests/FindPayeeCounterpartiesRequest.cs similarity index 98% rename from src/Mercoa.Client/Entity/Counterparty/requests/FindPayeeCounterpartiesRequest.cs rename to src/Mercoa.Client/Entity/Counterparty/Requests/FindPayeeCounterpartiesRequest.cs index 80aceba..893ebaa 100644 --- a/src/Mercoa.Client/Entity/Counterparty/requests/FindPayeeCounterpartiesRequest.cs +++ b/src/Mercoa.Client/Entity/Counterparty/Requests/FindPayeeCounterpartiesRequest.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Entity; public class FindPayeeCounterpartiesRequest diff --git a/src/Mercoa.Client/Entity/Counterparty/requests/FindPayorCounterpartiesRequest.cs b/src/Mercoa.Client/Entity/Counterparty/Requests/FindPayorCounterpartiesRequest.cs similarity index 98% rename from src/Mercoa.Client/Entity/Counterparty/requests/FindPayorCounterpartiesRequest.cs rename to src/Mercoa.Client/Entity/Counterparty/Requests/FindPayorCounterpartiesRequest.cs index 02f509f..92801c2 100644 --- a/src/Mercoa.Client/Entity/Counterparty/requests/FindPayorCounterpartiesRequest.cs +++ b/src/Mercoa.Client/Entity/Counterparty/Requests/FindPayorCounterpartiesRequest.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Entity; public class FindPayorCounterpartiesRequest diff --git a/src/Mercoa.Client/Entity/Customization/CustomizationClient.cs b/src/Mercoa.Client/Entity/Customization/CustomizationClient.cs index 89aa492..a8abe3e 100644 --- a/src/Mercoa.Client/Entity/Customization/CustomizationClient.cs +++ b/src/Mercoa.Client/Entity/Customization/CustomizationClient.cs @@ -1,6 +1,8 @@ using System.Text.Json; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Entity; public class CustomizationClient @@ -25,7 +27,7 @@ public async Task GetAsync() { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -46,6 +48,6 @@ public async Task UpdateAsync(EntityCustomizationRe { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } } diff --git a/src/Mercoa.Client/Entity/EmailLog/EmailLogClient.cs b/src/Mercoa.Client/Entity/EmailLog/EmailLogClient.cs index 6362372..dc3c6e2 100644 --- a/src/Mercoa.Client/Entity/EmailLog/EmailLogClient.cs +++ b/src/Mercoa.Client/Entity/EmailLog/EmailLogClient.cs @@ -2,6 +2,8 @@ using Mercoa.Client; using Mercoa.Client.Entity.EmailLog; +#nullable enable + namespace Mercoa.Client.Entity.EmailLog; public class EmailLogClient @@ -52,7 +54,7 @@ public async Task FindAsync(string entityId, EntityEmailLogReq { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -72,6 +74,6 @@ public async Task GetAsync(string entityId, string logId) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } } diff --git a/src/Mercoa.Client/Entity/EmailLog/requests/EntityEmailLogRequest.cs b/src/Mercoa.Client/Entity/EmailLog/Requests/EntityEmailLogRequest.cs similarity index 100% rename from src/Mercoa.Client/Entity/EmailLog/requests/EntityEmailLogRequest.cs rename to src/Mercoa.Client/Entity/EmailLog/Requests/EntityEmailLogRequest.cs diff --git a/src/Mercoa.Client/Entity/EntityClient.cs b/src/Mercoa.Client/Entity/EntityClient.cs index 69e4e25..545e9ac 100644 --- a/src/Mercoa.Client/Entity/EntityClient.cs +++ b/src/Mercoa.Client/Entity/EntityClient.cs @@ -4,6 +4,8 @@ using Mercoa.Client.Entity.EmailLog; using Mercoa.Client.Entity.User; +#nullable enable + namespace Mercoa.Client.Entity; public class EntityClient @@ -103,7 +105,7 @@ public async Task FindAsync(FindEntities request) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } public async Task CreateAsync(EntityRequest request) @@ -121,7 +123,7 @@ public async Task CreateAsync(EntityRequest request) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } public async Task GetAsync(string entityId) @@ -134,7 +136,7 @@ public async Task GetAsync(string entityId) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } public async Task UpdateAsync(string entityId, EntityUpdateRequest request) @@ -152,7 +154,7 @@ public async Task UpdateAsync(string entityId, EntityUpdateReque { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } public async void DeleteAsync(string entityId) @@ -212,7 +214,7 @@ public async Task GetTokenAsync(string entityId, TokenGenerationOptions { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -238,7 +240,7 @@ public async Task PlaidLinkTokenAsync(string entityId, PlaidLinkTokenReq { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -271,7 +273,7 @@ GenerateOnboardingLink request { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// diff --git a/src/Mercoa.Client/Entity/ExternalAccountingSystem/ExternalAccountingSystemClient.cs b/src/Mercoa.Client/Entity/ExternalAccountingSystem/ExternalAccountingSystemClient.cs index fc6f433..3922ab6 100644 --- a/src/Mercoa.Client/Entity/ExternalAccountingSystem/ExternalAccountingSystemClient.cs +++ b/src/Mercoa.Client/Entity/ExternalAccountingSystem/ExternalAccountingSystemClient.cs @@ -2,6 +2,8 @@ using Mercoa.Client; using Mercoa.Client.Entity; +#nullable enable + namespace Mercoa.Client.Entity; public class ExternalAccountingSystemClient @@ -35,7 +37,7 @@ ExternalAccountingSystemCompanyCreationRequest request responseBody ); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -55,7 +57,7 @@ public async Task ConnectAsync() { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// diff --git a/src/Mercoa.Client/Entity/ExternalAccountingSystem/requests/SyncExternalSystemRequest.cs b/src/Mercoa.Client/Entity/ExternalAccountingSystem/Requests/SyncExternalSystemRequest.cs similarity index 97% rename from src/Mercoa.Client/Entity/ExternalAccountingSystem/requests/SyncExternalSystemRequest.cs rename to src/Mercoa.Client/Entity/ExternalAccountingSystem/Requests/SyncExternalSystemRequest.cs index c8c089d..5cc1c20 100644 --- a/src/Mercoa.Client/Entity/ExternalAccountingSystem/requests/SyncExternalSystemRequest.cs +++ b/src/Mercoa.Client/Entity/ExternalAccountingSystem/Requests/SyncExternalSystemRequest.cs @@ -1,5 +1,7 @@ using Mercoa.Client.Entity; +#nullable enable + namespace Mercoa.Client.Entity; public class SyncExternalSystemRequest diff --git a/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/CodatCompanyCreationRequest.cs b/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/CodatCompanyCreationRequest.cs index 64879cb..97623c8 100644 --- a/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/CodatCompanyCreationRequest.cs +++ b/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/CodatCompanyCreationRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client.Entity; public class CodatCompanyCreationRequest diff --git a/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/CodatCompanyResponse.cs b/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/CodatCompanyResponse.cs index ee5d349..ce90fbe 100644 --- a/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/CodatCompanyResponse.cs +++ b/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/CodatCompanyResponse.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client.Entity; public class CodatCompanyResponse diff --git a/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/RutterCompanyCreationRequest.cs b/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/RutterCompanyCreationRequest.cs index 413b685..520b29b 100644 --- a/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/RutterCompanyCreationRequest.cs +++ b/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/RutterCompanyCreationRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client.Entity; public class RutterCompanyCreationRequest diff --git a/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/RutterCompanyResponse.cs b/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/RutterCompanyResponse.cs index df2491d..4924f31 100644 --- a/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/RutterCompanyResponse.cs +++ b/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/RutterCompanyResponse.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client.Entity; public class RutterCompanyResponse diff --git a/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/SyncType.cs b/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/SyncType.cs index 6fa427c..e9d5d43 100644 --- a/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/SyncType.cs +++ b/src/Mercoa.Client/Entity/ExternalAccountingSystem/Types/SyncType.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client.Core; +using Mercoa.Client.Entity; + +#nullable enable namespace Mercoa.Client.Entity; +[JsonConverter(typeof(StringEnumSerializer))] public enum SyncType { [EnumMember(Value = "none")] diff --git a/src/Mercoa.Client/Entity/Invoice/InvoiceClient.cs b/src/Mercoa.Client/Entity/Invoice/InvoiceClient.cs index f6f6cf9..705bd7f 100644 --- a/src/Mercoa.Client/Entity/Invoice/InvoiceClient.cs +++ b/src/Mercoa.Client/Entity/Invoice/InvoiceClient.cs @@ -2,6 +2,8 @@ using Mercoa.Client; using Mercoa.Client.Entity; +#nullable enable + namespace Mercoa.Client.Entity; public class InvoiceClient @@ -100,13 +102,15 @@ public async Task FindAsync(EntityGetInvoicesRequest reques { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// /// Get invoice metrics for an entity with the given filters. Invoices will be grouped by currency. If none of excludePayables, excludeReceivables, payerId, vendorId, or invoiceId status filters are provided, excludeReceivables will be set to true. /// - public async Task> MetricsAsync(InvoiceMetricsRequest request) + public async Task> MetricsAsync( + InvoiceMetricsRequest request + ) { var _query = new Dictionary() { }; if (request.Search != null) @@ -176,8 +180,8 @@ public async Task> MetricsAsync(InvoiceMetricsReque string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) { - return JsonSerializer.Deserialize>(responseBody); + return JsonSerializer.Deserialize>(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } } diff --git a/src/Mercoa.Client/Entity/Invoice/requests/EntityGetInvoicesRequest.cs b/src/Mercoa.Client/Entity/Invoice/Requests/EntityGetInvoicesRequest.cs similarity index 99% rename from src/Mercoa.Client/Entity/Invoice/requests/EntityGetInvoicesRequest.cs rename to src/Mercoa.Client/Entity/Invoice/Requests/EntityGetInvoicesRequest.cs index be5b2e6..55dd1c4 100644 --- a/src/Mercoa.Client/Entity/Invoice/requests/EntityGetInvoicesRequest.cs +++ b/src/Mercoa.Client/Entity/Invoice/Requests/EntityGetInvoicesRequest.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Entity; public class EntityGetInvoicesRequest diff --git a/src/Mercoa.Client/Entity/Invoice/requests/InvoiceMetricsRequest.cs b/src/Mercoa.Client/Entity/Invoice/Requests/InvoiceMetricsRequest.cs similarity index 99% rename from src/Mercoa.Client/Entity/Invoice/requests/InvoiceMetricsRequest.cs rename to src/Mercoa.Client/Entity/Invoice/Requests/InvoiceMetricsRequest.cs index 2376dfd..5b9a928 100644 --- a/src/Mercoa.Client/Entity/Invoice/requests/InvoiceMetricsRequest.cs +++ b/src/Mercoa.Client/Entity/Invoice/Requests/InvoiceMetricsRequest.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Entity; public class InvoiceMetricsRequest diff --git a/src/Mercoa.Client/Entity/Metadata/MetadataClient.cs b/src/Mercoa.Client/Entity/Metadata/MetadataClient.cs index b8baa72..bd9a1ae 100644 --- a/src/Mercoa.Client/Entity/Metadata/MetadataClient.cs +++ b/src/Mercoa.Client/Entity/Metadata/MetadataClient.cs @@ -1,6 +1,8 @@ using System.Text.Json; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Entity; public class MetadataClient @@ -15,7 +17,7 @@ public MetadataClient(RawClient client) /// /// Retrieve all metadata options associated with this entity /// - public async Task> GetAllAsync() + public async Task> GetAllAsync() { var response = await _client.MakeRequestAsync( new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/metadata" } @@ -23,15 +25,15 @@ public async Task> GetAllAsync() string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) { - return JsonSerializer.Deserialize>(responseBody); + return JsonSerializer.Deserialize>(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// /// Retrieve metadata associated with a specific key /// - public async Task> GetAsync(string key) + public async Task> GetAsync(string key) { var response = await _client.MakeRequestAsync( new RawClient.ApiRequest { Method = HttpMethod.Get, Path = $"/metadata/{key}" } @@ -39,15 +41,15 @@ public async Task> GetAsync(string key) string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) { - return JsonSerializer.Deserialize>(responseBody); + return JsonSerializer.Deserialize>(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// /// Update metadata associated with a specific key /// - public async Task> UpdateAsync(string key, List request) + public async Task> UpdateAsync(string key, IEnumerable request) { var response = await _client.MakeRequestAsync( new RawClient.ApiRequest @@ -60,9 +62,9 @@ public async Task> UpdateAsync(string key, List request) string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) { - return JsonSerializer.Deserialize>(responseBody); + return JsonSerializer.Deserialize>(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// diff --git a/src/Mercoa.Client/Entity/NotificationPolicy/NotificationPolicyClient.cs b/src/Mercoa.Client/Entity/NotificationPolicy/NotificationPolicyClient.cs index db52b19..89f23a3 100644 --- a/src/Mercoa.Client/Entity/NotificationPolicy/NotificationPolicyClient.cs +++ b/src/Mercoa.Client/Entity/NotificationPolicy/NotificationPolicyClient.cs @@ -1,6 +1,8 @@ using System.Text.Json; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Entity; public class NotificationPolicyClient @@ -15,7 +17,7 @@ public NotificationPolicyClient(RawClient client) /// /// Retrieve all notification policies associated with this entity /// - public async Task> GetAllAsync() + public async Task> GetAllAsync() { var response = await _client.MakeRequestAsync( new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/notification-policies" } @@ -23,9 +25,11 @@ public async Task> GetAllAsync() string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) { - return JsonSerializer.Deserialize>(responseBody); + return JsonSerializer.Deserialize>( + responseBody + ); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -45,7 +49,7 @@ public async Task GetAsync(NotificationType notifica { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -69,6 +73,6 @@ NotificationPolicyRequest request { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } } diff --git a/src/Mercoa.Client/Entity/PaymentMethod/PaymentMethodClient.cs b/src/Mercoa.Client/Entity/PaymentMethod/PaymentMethodClient.cs index ba372e4..05b2ec6 100644 --- a/src/Mercoa.Client/Entity/PaymentMethod/PaymentMethodClient.cs +++ b/src/Mercoa.Client/Entity/PaymentMethod/PaymentMethodClient.cs @@ -2,6 +2,8 @@ using Mercoa.Client; using Mercoa.Client.Entity; +#nullable enable + namespace Mercoa.Client.Entity; public class PaymentMethodClient @@ -13,7 +15,9 @@ public PaymentMethodClient(RawClient client) _client = client; } - public async Task> GetAllAsync(GetAllPaymentMethodsRequest request) + public async Task> GetAllAsync( + GetAllPaymentMethodsRequest request + ) { var _query = new Dictionary() { }; if (request.Type != null) @@ -31,9 +35,9 @@ public async Task> GetAllAsync(GetAllPaymentMethodsR string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) { - return JsonSerializer.Deserialize>(responseBody); + return JsonSerializer.Deserialize>(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } public async Task CreateAsync(PaymentMethodRequest request) @@ -51,7 +55,7 @@ public async Task CreateAsync(PaymentMethodRequest reques { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } public async Task GetAsync(string paymentMethodId) @@ -68,7 +72,7 @@ public async Task GetAsync(string paymentMethodId) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -92,7 +96,7 @@ PaymentMethodUpdateRequest request { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -126,7 +130,7 @@ public async Task InitiateMicroDepositsAsync(string payme { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -150,7 +154,7 @@ CompleteMicroDepositsRequest request { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -170,6 +174,6 @@ public async Task GetBalanceAsync(string paymentMe { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } } diff --git a/src/Mercoa.Client/Entity/PaymentMethod/requests/CompleteMicroDepositsRequest.cs b/src/Mercoa.Client/Entity/PaymentMethod/Requests/CompleteMicroDepositsRequest.cs similarity index 77% rename from src/Mercoa.Client/Entity/PaymentMethod/requests/CompleteMicroDepositsRequest.cs rename to src/Mercoa.Client/Entity/PaymentMethod/Requests/CompleteMicroDepositsRequest.cs index cfcbd8d..15a5d79 100644 --- a/src/Mercoa.Client/Entity/PaymentMethod/requests/CompleteMicroDepositsRequest.cs +++ b/src/Mercoa.Client/Entity/PaymentMethod/Requests/CompleteMicroDepositsRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client.Entity; public class CompleteMicroDepositsRequest @@ -8,5 +10,5 @@ public class CompleteMicroDepositsRequest /// The amounts of the micro deposits in cents /// [JsonPropertyName("amounts")] - public List Amounts { get; init; } + public IEnumerable Amounts { get; init; } } diff --git a/src/Mercoa.Client/Entity/PaymentMethod/requests/GetAllPaymentMethodsRequest.cs b/src/Mercoa.Client/Entity/PaymentMethod/Requests/GetAllPaymentMethodsRequest.cs similarity index 92% rename from src/Mercoa.Client/Entity/PaymentMethod/requests/GetAllPaymentMethodsRequest.cs rename to src/Mercoa.Client/Entity/PaymentMethod/Requests/GetAllPaymentMethodsRequest.cs index acd6314..72400ca 100644 --- a/src/Mercoa.Client/Entity/PaymentMethod/requests/GetAllPaymentMethodsRequest.cs +++ b/src/Mercoa.Client/Entity/PaymentMethod/Requests/GetAllPaymentMethodsRequest.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Entity; public class GetAllPaymentMethodsRequest diff --git a/src/Mercoa.Client/Entity/Representative/RepresentativeClient.cs b/src/Mercoa.Client/Entity/Representative/RepresentativeClient.cs index 986c5a8..0c6f7f1 100644 --- a/src/Mercoa.Client/Entity/Representative/RepresentativeClient.cs +++ b/src/Mercoa.Client/Entity/Representative/RepresentativeClient.cs @@ -1,6 +1,8 @@ using System.Text.Json; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Entity; public class RepresentativeClient @@ -15,7 +17,7 @@ public RepresentativeClient(RawClient client) /// /// Get representatives for an entity /// - public async Task> GetAllAsync() + public async Task> GetAllAsync() { var response = await _client.MakeRequestAsync( new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/representatives" } @@ -23,9 +25,9 @@ public async Task> GetAllAsync() string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) { - return JsonSerializer.Deserialize>(responseBody); + return JsonSerializer.Deserialize>(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } public async Task CreateAsync(RepresentativeRequest request) @@ -43,7 +45,7 @@ public async Task CreateAsync(RepresentativeRequest requ { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } public async Task GetAsync(string representativeId) @@ -60,7 +62,7 @@ public async Task GetAsync(string representativeId) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } public async void DeleteAsync(string representativeId) diff --git a/src/Mercoa.Client/Entity/requests/FindEntities.cs b/src/Mercoa.Client/Entity/Requests/FindEntities.cs similarity index 98% rename from src/Mercoa.Client/Entity/requests/FindEntities.cs rename to src/Mercoa.Client/Entity/Requests/FindEntities.cs index 22402bb..9fdd9d1 100644 --- a/src/Mercoa.Client/Entity/requests/FindEntities.cs +++ b/src/Mercoa.Client/Entity/Requests/FindEntities.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Entity; public class FindEntities diff --git a/src/Mercoa.Client/Entity/requests/GenerateOnboardingLink.cs b/src/Mercoa.Client/Entity/Requests/GenerateOnboardingLink.cs similarity index 97% rename from src/Mercoa.Client/Entity/requests/GenerateOnboardingLink.cs rename to src/Mercoa.Client/Entity/Requests/GenerateOnboardingLink.cs index ce91db4..921bb37 100644 --- a/src/Mercoa.Client/Entity/requests/GenerateOnboardingLink.cs +++ b/src/Mercoa.Client/Entity/Requests/GenerateOnboardingLink.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Entity; public class GenerateOnboardingLink diff --git a/src/Mercoa.Client/Entity/requests/PlaidLinkTokenRequest.cs b/src/Mercoa.Client/Entity/Requests/PlaidLinkTokenRequest.cs similarity index 100% rename from src/Mercoa.Client/Entity/requests/PlaidLinkTokenRequest.cs rename to src/Mercoa.Client/Entity/Requests/PlaidLinkTokenRequest.cs diff --git a/src/Mercoa.Client/Entity/requests/SendOnboardingLink.cs b/src/Mercoa.Client/Entity/Requests/SendOnboardingLink.cs similarity index 97% rename from src/Mercoa.Client/Entity/requests/SendOnboardingLink.cs rename to src/Mercoa.Client/Entity/Requests/SendOnboardingLink.cs index bc46afe..b38c90a 100644 --- a/src/Mercoa.Client/Entity/requests/SendOnboardingLink.cs +++ b/src/Mercoa.Client/Entity/Requests/SendOnboardingLink.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Entity; public class SendOnboardingLink diff --git a/src/Mercoa.Client/Entity/User/NotificationPolicy/NotificationPolicyClient.cs b/src/Mercoa.Client/Entity/User/NotificationPolicy/NotificationPolicyClient.cs index c228ab0..1481c68 100644 --- a/src/Mercoa.Client/Entity/User/NotificationPolicy/NotificationPolicyClient.cs +++ b/src/Mercoa.Client/Entity/User/NotificationPolicy/NotificationPolicyClient.cs @@ -1,6 +1,8 @@ using System.Text.Json; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Entity.User; public class NotificationPolicyClient @@ -15,7 +17,7 @@ public NotificationPolicyClient(RawClient client) /// /// Retrieve all notification policies associated with this entity user /// - public async Task> GetAllAsync() + public async Task> GetAllAsync() { var response = await _client.MakeRequestAsync( new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/notification-policies" } @@ -23,9 +25,11 @@ public async Task> GetAllAsync() string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) { - return JsonSerializer.Deserialize>(responseBody); + return JsonSerializer.Deserialize>( + responseBody + ); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -45,7 +49,7 @@ public async Task GetAsync(NotificationType noti { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -69,6 +73,6 @@ UserNotificationPolicyRequest request { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } } diff --git a/src/Mercoa.Client/Entity/User/Notifications/NotificationsClient.cs b/src/Mercoa.Client/Entity/User/Notifications/NotificationsClient.cs index 7ea170b..fc00883 100644 --- a/src/Mercoa.Client/Entity/User/Notifications/NotificationsClient.cs +++ b/src/Mercoa.Client/Entity/User/Notifications/NotificationsClient.cs @@ -2,6 +2,8 @@ using Mercoa.Client; using Mercoa.Client.Entity.User; +#nullable enable + namespace Mercoa.Client.Entity.User; public class NotificationsClient @@ -53,7 +55,7 @@ public async Task FindAsync(EntityGetNotificationsRequ { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } public async Task GetAsync(string notificationId) @@ -70,6 +72,6 @@ public async Task GetAsync(string notificationId) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } } diff --git a/src/Mercoa.Client/Entity/User/Notifications/requests/EntityGetNotificationsRequest.cs b/src/Mercoa.Client/Entity/User/Notifications/Requests/EntityGetNotificationsRequest.cs similarity index 98% rename from src/Mercoa.Client/Entity/User/Notifications/requests/EntityGetNotificationsRequest.cs rename to src/Mercoa.Client/Entity/User/Notifications/Requests/EntityGetNotificationsRequest.cs index 3ee8589..e20da08 100644 --- a/src/Mercoa.Client/Entity/User/Notifications/requests/EntityGetNotificationsRequest.cs +++ b/src/Mercoa.Client/Entity/User/Notifications/Requests/EntityGetNotificationsRequest.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Entity.User; public class EntityGetNotificationsRequest diff --git a/src/Mercoa.Client/Entity/User/requests/EntityFindEntityRequest.cs b/src/Mercoa.Client/Entity/User/Requests/EntityFindEntityRequest.cs similarity index 100% rename from src/Mercoa.Client/Entity/User/requests/EntityFindEntityRequest.cs rename to src/Mercoa.Client/Entity/User/Requests/EntityFindEntityRequest.cs diff --git a/src/Mercoa.Client/Entity/User/UserClient.cs b/src/Mercoa.Client/Entity/User/UserClient.cs index 4f592d4..f69a123 100644 --- a/src/Mercoa.Client/Entity/User/UserClient.cs +++ b/src/Mercoa.Client/Entity/User/UserClient.cs @@ -2,6 +2,8 @@ using Mercoa.Client; using Mercoa.Client.Entity.User; +#nullable enable + namespace Mercoa.Client.Entity.User; public class UserClient @@ -20,9 +22,9 @@ public UserClient(RawClient client) public NotificationsClient Notifications { get; } /// - /// Get all entity users + /// Get all entity users (DEPRECATED, use Search Entity Users) /// - public async Task> GetAllAsync(string entityId) + public async Task> GetAllAsync(string entityId) { var response = await _client.MakeRequestAsync( new RawClient.ApiRequest { Method = HttpMethod.Get, Path = $"/{entityId}/users" } @@ -30,13 +32,13 @@ public async Task> GetAllAsync(string entityId) string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) { - return JsonSerializer.Deserialize>(responseBody); + return JsonSerializer.Deserialize>(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// - /// Get all entity users + /// Search entity users /// public async Task FindAsync( string entityId, @@ -81,7 +83,7 @@ EntityFindEntityRequest request { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } public async Task CreateAsync(string entityId, EntityUserRequest request) @@ -99,7 +101,7 @@ public async Task CreateAsync(string entityId, EntityUserReq { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -119,7 +121,7 @@ public async Task GetAsync(string entityId, string userId) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -144,7 +146,7 @@ EntityUserRequest request { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -183,6 +185,6 @@ TokenGenerationOptions request { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } } diff --git a/src/Mercoa.Client/EntityTypes/EntityTypesClient.cs b/src/Mercoa.Client/EntityTypes/EntityTypesClient.cs index af6249a..b227510 100644 --- a/src/Mercoa.Client/EntityTypes/EntityTypesClient.cs +++ b/src/Mercoa.Client/EntityTypes/EntityTypesClient.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class EntityTypesClient diff --git a/src/Mercoa.Client/EntityTypes/Types/AccountType.cs b/src/Mercoa.Client/EntityTypes/Types/AccountType.cs index 0d94b27..a4e6550 100644 --- a/src/Mercoa.Client/EntityTypes/Types/AccountType.cs +++ b/src/Mercoa.Client/EntityTypes/Types/AccountType.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum AccountType { [EnumMember(Value = "business")] diff --git a/src/Mercoa.Client/EntityTypes/Types/AmountTrigger.cs b/src/Mercoa.Client/EntityTypes/Types/AmountTrigger.cs index e66d696..f0727ea 100644 --- a/src/Mercoa.Client/EntityTypes/Types/AmountTrigger.cs +++ b/src/Mercoa.Client/EntityTypes/Types/AmountTrigger.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class AmountTrigger diff --git a/src/Mercoa.Client/EntityTypes/Types/ApprovalPolicyRequest.cs b/src/Mercoa.Client/EntityTypes/Types/ApprovalPolicyRequest.cs index 2bba2ce..7130bed 100644 --- a/src/Mercoa.Client/EntityTypes/Types/ApprovalPolicyRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/ApprovalPolicyRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class ApprovalPolicyRequest @@ -9,7 +11,7 @@ public class ApprovalPolicyRequest /// List of triggers that will cause this policy to be evaluated. If no triggers are provided, the policy will be evaluated for all invoices. /// [JsonPropertyName("trigger")] - public List Trigger { get; init; } + public IEnumerable Trigger { get; init; } [JsonPropertyName("rule")] public Rule Rule { get; init; } diff --git a/src/Mercoa.Client/EntityTypes/Types/ApprovalPolicyResponse.cs b/src/Mercoa.Client/EntityTypes/Types/ApprovalPolicyResponse.cs index db87a3f..a8c7ce2 100644 --- a/src/Mercoa.Client/EntityTypes/Types/ApprovalPolicyResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/ApprovalPolicyResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class ApprovalPolicyResponse @@ -9,7 +11,7 @@ public class ApprovalPolicyResponse public string Id { get; init; } [JsonPropertyName("trigger")] - public List Trigger { get; init; } + public IEnumerable Trigger { get; init; } [JsonPropertyName("rule")] public Rule Rule { get; init; } diff --git a/src/Mercoa.Client/EntityTypes/Types/ApprovalPolicyUpdateRequest.cs b/src/Mercoa.Client/EntityTypes/Types/ApprovalPolicyUpdateRequest.cs index 1ad05cd..f8b2e6a 100644 --- a/src/Mercoa.Client/EntityTypes/Types/ApprovalPolicyUpdateRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/ApprovalPolicyUpdateRequest.cs @@ -1,12 +1,14 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class ApprovalPolicyUpdateRequest { [JsonPropertyName("trigger")] - public List? Trigger { get; init; } + public IEnumerable? Trigger { get; init; } [JsonPropertyName("rule")] public Rule? Rule { get; init; } diff --git a/src/Mercoa.Client/EntityTypes/Types/ApproverRule.cs b/src/Mercoa.Client/EntityTypes/Types/ApproverRule.cs index c9a7d3e..5a03ad7 100644 --- a/src/Mercoa.Client/EntityTypes/Types/ApproverRule.cs +++ b/src/Mercoa.Client/EntityTypes/Types/ApproverRule.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class ApproverRule diff --git a/src/Mercoa.Client/EntityTypes/Types/BusinessProfileRequest.cs b/src/Mercoa.Client/EntityTypes/Types/BusinessProfileRequest.cs index 3b0da87..2c46517 100644 --- a/src/Mercoa.Client/EntityTypes/Types/BusinessProfileRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/BusinessProfileRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class BusinessProfileRequest diff --git a/src/Mercoa.Client/EntityTypes/Types/BusinessProfileResponse.cs b/src/Mercoa.Client/EntityTypes/Types/BusinessProfileResponse.cs index 8911215..74cea03 100644 --- a/src/Mercoa.Client/EntityTypes/Types/BusinessProfileResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/BusinessProfileResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class BusinessProfileResponse diff --git a/src/Mercoa.Client/EntityTypes/Types/BusinessType.cs b/src/Mercoa.Client/EntityTypes/Types/BusinessType.cs index 4a129d1..b849224 100644 --- a/src/Mercoa.Client/EntityTypes/Types/BusinessType.cs +++ b/src/Mercoa.Client/EntityTypes/Types/BusinessType.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum BusinessType { [EnumMember(Value = "soleProprietorship")] diff --git a/src/Mercoa.Client/EntityTypes/Types/CounterpartyInvoiceMetricsResponse.cs b/src/Mercoa.Client/EntityTypes/Types/CounterpartyInvoiceMetricsResponse.cs index 892530f..133dd4d 100644 --- a/src/Mercoa.Client/EntityTypes/Types/CounterpartyInvoiceMetricsResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/CounterpartyInvoiceMetricsResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class CounterpartyInvoiceMetricsResponse @@ -12,5 +14,5 @@ public class CounterpartyInvoiceMetricsResponse public double TotalAmount { get; init; } [JsonPropertyName("statuses")] - public List Statuses { get; init; } + public IEnumerable Statuses { get; init; } } diff --git a/src/Mercoa.Client/EntityTypes/Types/CounterpartyInvoiceMetricsStatusResponse.cs b/src/Mercoa.Client/EntityTypes/Types/CounterpartyInvoiceMetricsStatusResponse.cs index 45dee0d..62ea966 100644 --- a/src/Mercoa.Client/EntityTypes/Types/CounterpartyInvoiceMetricsStatusResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/CounterpartyInvoiceMetricsStatusResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class CounterpartyInvoiceMetricsStatusResponse diff --git a/src/Mercoa.Client/EntityTypes/Types/CounterpartyNetworkType.cs b/src/Mercoa.Client/EntityTypes/Types/CounterpartyNetworkType.cs index 55b161b..dc1d2f0 100644 --- a/src/Mercoa.Client/EntityTypes/Types/CounterpartyNetworkType.cs +++ b/src/Mercoa.Client/EntityTypes/Types/CounterpartyNetworkType.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum CounterpartyNetworkType { [EnumMember(Value = "ENTITY")] diff --git a/src/Mercoa.Client/EntityTypes/Types/CounterpartyResponse.cs b/src/Mercoa.Client/EntityTypes/Types/CounterpartyResponse.cs index 4e1b358..701d5e0 100644 --- a/src/Mercoa.Client/EntityTypes/Types/CounterpartyResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/CounterpartyResponse.cs @@ -1,15 +1,17 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class CounterpartyResponse { [JsonPropertyName("paymentMethods")] - public List PaymentMethods { get; init; } + public IEnumerable PaymentMethods { get; init; } [JsonPropertyName("counterpartyType")] - public List CounterpartyType { get; init; } + public IEnumerable CounterpartyType { get; init; } [JsonPropertyName("invoiceMetrics")] public CounterpartyInvoiceMetricsResponse? InvoiceMetrics { get; init; } @@ -39,7 +41,7 @@ public class CounterpartyResponse /// Email inbox alias addresses. Used when forwarding emails to the emailTo address from an alias. /// [JsonPropertyName("emailToAlias")] - public List? EmailToAlias { get; init; } + public IEnumerable? EmailToAlias { get; init; } /// /// True if this entity has a direct relationship with your organization. diff --git a/src/Mercoa.Client/EntityTypes/Types/Ein.cs b/src/Mercoa.Client/EntityTypes/Types/Ein.cs index e3aecb6..b77c1ad 100644 --- a/src/Mercoa.Client/EntityTypes/Types/Ein.cs +++ b/src/Mercoa.Client/EntityTypes/Types/Ein.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class Ein diff --git a/src/Mercoa.Client/EntityTypes/Types/EntityAddPayeesRequest.cs b/src/Mercoa.Client/EntityTypes/Types/EntityAddPayeesRequest.cs index 2940d80..8546345 100644 --- a/src/Mercoa.Client/EntityTypes/Types/EntityAddPayeesRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/EntityAddPayeesRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class EntityAddPayeesRequest @@ -8,5 +10,5 @@ public class EntityAddPayeesRequest /// List of payee entity IDs to associate with the entity /// [JsonPropertyName("payees")] - public List Payees { get; init; } + public IEnumerable Payees { get; init; } } diff --git a/src/Mercoa.Client/EntityTypes/Types/EntityAddPayorsRequest.cs b/src/Mercoa.Client/EntityTypes/Types/EntityAddPayorsRequest.cs index bcf6075..b2423fa 100644 --- a/src/Mercoa.Client/EntityTypes/Types/EntityAddPayorsRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/EntityAddPayorsRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class EntityAddPayorsRequest @@ -8,5 +10,5 @@ public class EntityAddPayorsRequest /// List of payor entity IDs to associate with the entity /// [JsonPropertyName("payors")] - public List Payors { get; init; } + public IEnumerable Payors { get; init; } } diff --git a/src/Mercoa.Client/EntityTypes/Types/EntityCustomizationRequest.cs b/src/Mercoa.Client/EntityTypes/Types/EntityCustomizationRequest.cs index 95c40a8..3174c67 100644 --- a/src/Mercoa.Client/EntityTypes/Types/EntityCustomizationRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/EntityCustomizationRequest.cs @@ -1,19 +1,21 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class EntityCustomizationRequest { [JsonPropertyName("metadata")] - public List Metadata { get; init; } + public IEnumerable Metadata { get; init; } [JsonPropertyName("paymentSource")] - public List PaymentSource { get; init; } + public IEnumerable PaymentSource { get; init; } [JsonPropertyName("backupDisbursement")] - public List BackupDisbursement { get; init; } + public IEnumerable BackupDisbursement { get; init; } [JsonPropertyName("paymentDestination")] - public List PaymentDestination { get; init; } + public IEnumerable PaymentDestination { get; init; } } diff --git a/src/Mercoa.Client/EntityTypes/Types/EntityCustomizationResponse.cs b/src/Mercoa.Client/EntityTypes/Types/EntityCustomizationResponse.cs index 7d73ec3..c9a2f5c 100644 --- a/src/Mercoa.Client/EntityTypes/Types/EntityCustomizationResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/EntityCustomizationResponse.cs @@ -1,19 +1,21 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class EntityCustomizationResponse { [JsonPropertyName("metadata")] - public List Metadata { get; init; } + public IEnumerable Metadata { get; init; } [JsonPropertyName("paymentSource")] - public List PaymentSource { get; init; } + public IEnumerable PaymentSource { get; init; } [JsonPropertyName("backupDisbursement")] - public List BackupDisbursement { get; init; } + public IEnumerable BackupDisbursement { get; init; } [JsonPropertyName("paymentDestination")] - public List PaymentDestination { get; init; } + public IEnumerable PaymentDestination { get; init; } } diff --git a/src/Mercoa.Client/EntityTypes/Types/EntityHidePayeesRequest.cs b/src/Mercoa.Client/EntityTypes/Types/EntityHidePayeesRequest.cs index 4eb9dbb..d921481 100644 --- a/src/Mercoa.Client/EntityTypes/Types/EntityHidePayeesRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/EntityHidePayeesRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class EntityHidePayeesRequest @@ -8,5 +10,5 @@ public class EntityHidePayeesRequest /// List of payee entity IDs to hide /// [JsonPropertyName("payees")] - public List Payees { get; init; } + public IEnumerable Payees { get; init; } } diff --git a/src/Mercoa.Client/EntityTypes/Types/EntityHidePayorsRequest.cs b/src/Mercoa.Client/EntityTypes/Types/EntityHidePayorsRequest.cs index a805173..c50df53 100644 --- a/src/Mercoa.Client/EntityTypes/Types/EntityHidePayorsRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/EntityHidePayorsRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class EntityHidePayorsRequest @@ -8,5 +10,5 @@ public class EntityHidePayorsRequest /// List of payor entity IDs to hide /// [JsonPropertyName("payors")] - public List Payors { get; init; } + public IEnumerable Payors { get; init; } } diff --git a/src/Mercoa.Client/EntityTypes/Types/EntityMetadataResponse.cs b/src/Mercoa.Client/EntityTypes/Types/EntityMetadataResponse.cs index 08a81d0..4b707d3 100644 --- a/src/Mercoa.Client/EntityTypes/Types/EntityMetadataResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/EntityMetadataResponse.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class EntityMetadataResponse @@ -8,5 +10,5 @@ public class EntityMetadataResponse public string Key { get; init; } [JsonPropertyName("value")] - public List Value { get; init; } + public IEnumerable Value { get; init; } } diff --git a/src/Mercoa.Client/EntityTypes/Types/EntityOnboardingLinkType.cs b/src/Mercoa.Client/EntityTypes/Types/EntityOnboardingLinkType.cs index 9f115d0..2e3bf80 100644 --- a/src/Mercoa.Client/EntityTypes/Types/EntityOnboardingLinkType.cs +++ b/src/Mercoa.Client/EntityTypes/Types/EntityOnboardingLinkType.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum EntityOnboardingLinkType { [EnumMember(Value = "PAYEE")] diff --git a/src/Mercoa.Client/EntityTypes/Types/EntityRequest.cs b/src/Mercoa.Client/EntityTypes/Types/EntityRequest.cs index 01fc47f..e37fe8a 100644 --- a/src/Mercoa.Client/EntityTypes/Types/EntityRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/EntityRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class EntityRequest @@ -21,7 +23,7 @@ public class EntityRequest /// Email inbox alias addresses. Used when forwarding emails to the emailTo address from an alias. Include the full email address. /// [JsonPropertyName("emailToAlias")] - public List? EmailToAlias { get; init; } + public IEnumerable? EmailToAlias { get; init; } /// /// If this entity has a direct relationship with your organization (e.g your direct customer or client), set this to true. Otherwise, set to false (e.g your customer's vendors). diff --git a/src/Mercoa.Client/EntityTypes/Types/EntityResponse.cs b/src/Mercoa.Client/EntityTypes/Types/EntityResponse.cs index 174e093..370147e 100644 --- a/src/Mercoa.Client/EntityTypes/Types/EntityResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/EntityResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class EntityResponse @@ -30,7 +32,7 @@ public class EntityResponse /// Email inbox alias addresses. Used when forwarding emails to the emailTo address from an alias. /// [JsonPropertyName("emailToAlias")] - public List? EmailToAlias { get; init; } + public IEnumerable? EmailToAlias { get; init; } /// /// True if this entity has a direct relationship with your organization. diff --git a/src/Mercoa.Client/EntityTypes/Types/EntityStatus.cs b/src/Mercoa.Client/EntityTypes/Types/EntityStatus.cs index 5863a77..41cff31 100644 --- a/src/Mercoa.Client/EntityTypes/Types/EntityStatus.cs +++ b/src/Mercoa.Client/EntityTypes/Types/EntityStatus.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum EntityStatus { [EnumMember(Value = "unverified")] diff --git a/src/Mercoa.Client/EntityTypes/Types/EntityUpdateRequest.cs b/src/Mercoa.Client/EntityTypes/Types/EntityUpdateRequest.cs index 51c27e2..e37942b 100644 --- a/src/Mercoa.Client/EntityTypes/Types/EntityUpdateRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/EntityUpdateRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class EntityUpdateRequest @@ -21,7 +23,7 @@ public class EntityUpdateRequest /// Email inbox alias addresses. Used when forwarding emails to the emailTo address from an alias. Include the full email address. /// [JsonPropertyName("emailToAlias")] - public List? EmailToAlias { get; init; } + public IEnumerable? EmailToAlias { get; init; } /// /// If this entity has a direct relationship with your organization (e.g your direct customer or client), set this to true. Otherwise, set to false (e.g your customer's vendors). diff --git a/src/Mercoa.Client/EntityTypes/Types/EntityUserRequest.cs b/src/Mercoa.Client/EntityTypes/Types/EntityUserRequest.cs index e71fdfd..58634a9 100644 --- a/src/Mercoa.Client/EntityTypes/Types/EntityUserRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/EntityUserRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class EntityUserRequest @@ -20,5 +22,5 @@ public class EntityUserRequest /// List of roles. A role can be any string. For example: "payer", "approver", "viewer" /// [JsonPropertyName("roles")] - public List? Roles { get; init; } + public IEnumerable? Roles { get; init; } } diff --git a/src/Mercoa.Client/EntityTypes/Types/EntityUserResponse.cs b/src/Mercoa.Client/EntityTypes/Types/EntityUserResponse.cs index d5e8355..eec9b39 100644 --- a/src/Mercoa.Client/EntityTypes/Types/EntityUserResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/EntityUserResponse.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class EntityUserResponse @@ -20,7 +22,7 @@ public class EntityUserResponse public string? Name { get; init; } [JsonPropertyName("roles")] - public List Roles { get; init; } + public IEnumerable Roles { get; init; } [JsonPropertyName("createdAt")] public DateTime CreatedAt { get; init; } diff --git a/src/Mercoa.Client/EntityTypes/Types/EntityWithPaymentMethodResponse.cs b/src/Mercoa.Client/EntityTypes/Types/EntityWithPaymentMethodResponse.cs index 8a6a847..6050b3b 100644 --- a/src/Mercoa.Client/EntityTypes/Types/EntityWithPaymentMethodResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/EntityWithPaymentMethodResponse.cs @@ -1,12 +1,14 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class EntityWithPaymentMethodResponse { [JsonPropertyName("paymentMethods")] - public List? PaymentMethods { get; init; } + public IEnumerable? PaymentMethods { get; init; } [JsonPropertyName("id")] public string Id { get; init; } @@ -33,7 +35,7 @@ public class EntityWithPaymentMethodResponse /// Email inbox alias addresses. Used when forwarding emails to the emailTo address from an alias. /// [JsonPropertyName("emailToAlias")] - public List? EmailToAlias { get; init; } + public IEnumerable? EmailToAlias { get; init; } /// /// True if this entity has a direct relationship with your organization. diff --git a/src/Mercoa.Client/EntityTypes/Types/FindCounterpartiesResponse.cs b/src/Mercoa.Client/EntityTypes/Types/FindCounterpartiesResponse.cs index ea39b56..8511c85 100644 --- a/src/Mercoa.Client/EntityTypes/Types/FindCounterpartiesResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/FindCounterpartiesResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class FindCounterpartiesResponse @@ -18,5 +20,5 @@ public class FindCounterpartiesResponse public bool HasMore { get; init; } [JsonPropertyName("data")] - public List Data { get; init; } + public IEnumerable Data { get; init; } } diff --git a/src/Mercoa.Client/EntityTypes/Types/FindEntityResponse.cs b/src/Mercoa.Client/EntityTypes/Types/FindEntityResponse.cs index d069727..2367608 100644 --- a/src/Mercoa.Client/EntityTypes/Types/FindEntityResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/FindEntityResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class FindEntityResponse @@ -18,5 +20,5 @@ public class FindEntityResponse public bool HasMore { get; init; } [JsonPropertyName("data")] - public List Data { get; init; } + public IEnumerable Data { get; init; } } diff --git a/src/Mercoa.Client/EntityTypes/Types/FindEntityUserResponse.cs b/src/Mercoa.Client/EntityTypes/Types/FindEntityUserResponse.cs index 2f4ef0e..7e6b2a0 100644 --- a/src/Mercoa.Client/EntityTypes/Types/FindEntityUserResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/FindEntityUserResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class FindEntityUserResponse @@ -18,5 +20,5 @@ public class FindEntityUserResponse public bool HasMore { get; init; } [JsonPropertyName("data")] - public List Data { get; init; } + public IEnumerable Data { get; init; } } diff --git a/src/Mercoa.Client/EntityTypes/Types/FindNotificationResponse.cs b/src/Mercoa.Client/EntityTypes/Types/FindNotificationResponse.cs index 85eefa4..fc90890 100644 --- a/src/Mercoa.Client/EntityTypes/Types/FindNotificationResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/FindNotificationResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class FindNotificationResponse @@ -18,5 +20,5 @@ public class FindNotificationResponse public bool HasMore { get; init; } [JsonPropertyName("data")] - public List Data { get; init; } + public IEnumerable Data { get; init; } } diff --git a/src/Mercoa.Client/EntityTypes/Types/IndividualProfileRequest.cs b/src/Mercoa.Client/EntityTypes/Types/IndividualProfileRequest.cs index 3ebd12d..f716539 100644 --- a/src/Mercoa.Client/EntityTypes/Types/IndividualProfileRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/IndividualProfileRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class IndividualProfileRequest diff --git a/src/Mercoa.Client/EntityTypes/Types/IndividualProfileResponse.cs b/src/Mercoa.Client/EntityTypes/Types/IndividualProfileResponse.cs index 30c93b1..7748c8c 100644 --- a/src/Mercoa.Client/EntityTypes/Types/IndividualProfileResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/IndividualProfileResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class IndividualProfileResponse diff --git a/src/Mercoa.Client/EntityTypes/Types/LineItemAvailabilities.cs b/src/Mercoa.Client/EntityTypes/Types/LineItemAvailabilities.cs index 58ed594..935d457 100644 --- a/src/Mercoa.Client/EntityTypes/Types/LineItemAvailabilities.cs +++ b/src/Mercoa.Client/EntityTypes/Types/LineItemAvailabilities.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum LineItemAvailabilities { [EnumMember(Value = "DISABLED")] diff --git a/src/Mercoa.Client/EntityTypes/Types/MetadataCustomizationRequest.cs b/src/Mercoa.Client/EntityTypes/Types/MetadataCustomizationRequest.cs index 13be1c8..69d4fd4 100644 --- a/src/Mercoa.Client/EntityTypes/Types/MetadataCustomizationRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/MetadataCustomizationRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class MetadataCustomizationRequest diff --git a/src/Mercoa.Client/EntityTypes/Types/MetadataTrigger.cs b/src/Mercoa.Client/EntityTypes/Types/MetadataTrigger.cs index 691cb21..1e89797 100644 --- a/src/Mercoa.Client/EntityTypes/Types/MetadataTrigger.cs +++ b/src/Mercoa.Client/EntityTypes/Types/MetadataTrigger.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class MetadataTrigger diff --git a/src/Mercoa.Client/EntityTypes/Types/NotificationPolicyRequest.cs b/src/Mercoa.Client/EntityTypes/Types/NotificationPolicyRequest.cs index 39b6223..fa0e427 100644 --- a/src/Mercoa.Client/EntityTypes/Types/NotificationPolicyRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/NotificationPolicyRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class NotificationPolicyRequest @@ -14,5 +16,5 @@ public class NotificationPolicyRequest /// List of user roles that should receive notifications in addition to the default users for this notification type /// [JsonPropertyName("additionalRoles")] - public List AdditionalRoles { get; init; } + public IEnumerable AdditionalRoles { get; init; } } diff --git a/src/Mercoa.Client/EntityTypes/Types/NotificationPolicyResponse.cs b/src/Mercoa.Client/EntityTypes/Types/NotificationPolicyResponse.cs index 7923e97..0fd6166 100644 --- a/src/Mercoa.Client/EntityTypes/Types/NotificationPolicyResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/NotificationPolicyResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class NotificationPolicyResponse @@ -15,7 +17,7 @@ public class NotificationPolicyResponse /// List of user roles that should receive notifications in addition to the default users for this notification type /// [JsonPropertyName("additionalRoles")] - public List AdditionalRoles { get; init; } + public IEnumerable AdditionalRoles { get; init; } [JsonPropertyName("type")] public NotificationType Type { get; init; } diff --git a/src/Mercoa.Client/EntityTypes/Types/NotificationResponse.cs b/src/Mercoa.Client/EntityTypes/Types/NotificationResponse.cs index 209ad6e..e380de2 100644 --- a/src/Mercoa.Client/EntityTypes/Types/NotificationResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/NotificationResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class NotificationResponse diff --git a/src/Mercoa.Client/EntityTypes/Types/NotificationType.cs b/src/Mercoa.Client/EntityTypes/Types/NotificationType.cs index e0e5ccb..aa7b1da 100644 --- a/src/Mercoa.Client/EntityTypes/Types/NotificationType.cs +++ b/src/Mercoa.Client/EntityTypes/Types/NotificationType.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum NotificationType { [EnumMember(Value = "INVOICE_APPROVAL_NEEDED")] diff --git a/src/Mercoa.Client/EntityTypes/Types/PaymentMethodCustomizationRequest.cs b/src/Mercoa.Client/EntityTypes/Types/PaymentMethodCustomizationRequest.cs index ba4336f..58779f6 100644 --- a/src/Mercoa.Client/EntityTypes/Types/PaymentMethodCustomizationRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/PaymentMethodCustomizationRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class PaymentMethodCustomizationRequest diff --git a/src/Mercoa.Client/EntityTypes/Types/ProfileRequest.cs b/src/Mercoa.Client/EntityTypes/Types/ProfileRequest.cs index 1c8d2dc..cc49836 100644 --- a/src/Mercoa.Client/EntityTypes/Types/ProfileRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/ProfileRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class ProfileRequest diff --git a/src/Mercoa.Client/EntityTypes/Types/ProfileResponse.cs b/src/Mercoa.Client/EntityTypes/Types/ProfileResponse.cs index 7c45650..1df392b 100644 --- a/src/Mercoa.Client/EntityTypes/Types/ProfileResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/ProfileResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class ProfileResponse diff --git a/src/Mercoa.Client/EntityTypes/Types/RepresentativeRequest.cs b/src/Mercoa.Client/EntityTypes/Types/RepresentativeRequest.cs index c92d4a1..5464e4d 100644 --- a/src/Mercoa.Client/EntityTypes/Types/RepresentativeRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/RepresentativeRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class RepresentativeRequest diff --git a/src/Mercoa.Client/EntityTypes/Types/RepresentativeResponse.cs b/src/Mercoa.Client/EntityTypes/Types/RepresentativeResponse.cs index 2551510..71f38a0 100644 --- a/src/Mercoa.Client/EntityTypes/Types/RepresentativeResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/RepresentativeResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class RepresentativeResponse diff --git a/src/Mercoa.Client/EntityTypes/Types/Responsibilities.cs b/src/Mercoa.Client/EntityTypes/Types/Responsibilities.cs index bdd4a96..87dfbdb 100644 --- a/src/Mercoa.Client/EntityTypes/Types/Responsibilities.cs +++ b/src/Mercoa.Client/EntityTypes/Types/Responsibilities.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class Responsibilities diff --git a/src/Mercoa.Client/EntityTypes/Types/TaxId.cs b/src/Mercoa.Client/EntityTypes/Types/TaxId.cs index 32682be..2f12566 100644 --- a/src/Mercoa.Client/EntityTypes/Types/TaxId.cs +++ b/src/Mercoa.Client/EntityTypes/Types/TaxId.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class TaxId diff --git a/src/Mercoa.Client/EntityTypes/Types/TokenGenerationEntityOptions.cs b/src/Mercoa.Client/EntityTypes/Types/TokenGenerationEntityOptions.cs index ca38d91..fd701ef 100644 --- a/src/Mercoa.Client/EntityTypes/Types/TokenGenerationEntityOptions.cs +++ b/src/Mercoa.Client/EntityTypes/Types/TokenGenerationEntityOptions.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class TokenGenerationEntityOptions diff --git a/src/Mercoa.Client/EntityTypes/Types/TokenGenerationInvoiceOptions.cs b/src/Mercoa.Client/EntityTypes/Types/TokenGenerationInvoiceOptions.cs index fbbfc3b..a176387 100644 --- a/src/Mercoa.Client/EntityTypes/Types/TokenGenerationInvoiceOptions.cs +++ b/src/Mercoa.Client/EntityTypes/Types/TokenGenerationInvoiceOptions.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class TokenGenerationInvoiceOptions @@ -18,5 +20,5 @@ public class TokenGenerationInvoiceOptions public bool? DisableLineItems { get; init; } [JsonPropertyName("status")] - public List Status { get; init; } + public IEnumerable Status { get; init; } } diff --git a/src/Mercoa.Client/EntityTypes/Types/TokenGenerationOptions.cs b/src/Mercoa.Client/EntityTypes/Types/TokenGenerationOptions.cs index 6e70c96..607abae 100644 --- a/src/Mercoa.Client/EntityTypes/Types/TokenGenerationOptions.cs +++ b/src/Mercoa.Client/EntityTypes/Types/TokenGenerationOptions.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class TokenGenerationOptions diff --git a/src/Mercoa.Client/EntityTypes/Types/TokenGenerationPagesOptions.cs b/src/Mercoa.Client/EntityTypes/Types/TokenGenerationPagesOptions.cs index b1e68ce..9a5e930 100644 --- a/src/Mercoa.Client/EntityTypes/Types/TokenGenerationPagesOptions.cs +++ b/src/Mercoa.Client/EntityTypes/Types/TokenGenerationPagesOptions.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class TokenGenerationPagesOptions diff --git a/src/Mercoa.Client/EntityTypes/Types/TokenGenerationStyleOptions.cs b/src/Mercoa.Client/EntityTypes/Types/TokenGenerationStyleOptions.cs index a78dba1..f2b8195 100644 --- a/src/Mercoa.Client/EntityTypes/Types/TokenGenerationStyleOptions.cs +++ b/src/Mercoa.Client/EntityTypes/Types/TokenGenerationStyleOptions.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class TokenGenerationStyleOptions diff --git a/src/Mercoa.Client/EntityTypes/Types/TokenGenerationVendorOptions.cs b/src/Mercoa.Client/EntityTypes/Types/TokenGenerationVendorOptions.cs index dc74165..1b940b3 100644 --- a/src/Mercoa.Client/EntityTypes/Types/TokenGenerationVendorOptions.cs +++ b/src/Mercoa.Client/EntityTypes/Types/TokenGenerationVendorOptions.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class TokenGenerationVendorOptions diff --git a/src/Mercoa.Client/EntityTypes/Types/UserNotificationPolicyRequest.cs b/src/Mercoa.Client/EntityTypes/Types/UserNotificationPolicyRequest.cs index b417607..91a96bd 100644 --- a/src/Mercoa.Client/EntityTypes/Types/UserNotificationPolicyRequest.cs +++ b/src/Mercoa.Client/EntityTypes/Types/UserNotificationPolicyRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class UserNotificationPolicyRequest diff --git a/src/Mercoa.Client/EntityTypes/Types/UserNotificationPolicyResponse.cs b/src/Mercoa.Client/EntityTypes/Types/UserNotificationPolicyResponse.cs index 62f0649..1992a13 100644 --- a/src/Mercoa.Client/EntityTypes/Types/UserNotificationPolicyResponse.cs +++ b/src/Mercoa.Client/EntityTypes/Types/UserNotificationPolicyResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class UserNotificationPolicyResponse diff --git a/src/Mercoa.Client/EntityTypes/Types/VendorNetwork.cs b/src/Mercoa.Client/EntityTypes/Types/VendorNetwork.cs index da7b6e2..ad93fcf 100644 --- a/src/Mercoa.Client/EntityTypes/Types/VendorNetwork.cs +++ b/src/Mercoa.Client/EntityTypes/Types/VendorNetwork.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum VendorNetwork { [EnumMember(Value = "all")] diff --git a/src/Mercoa.Client/EntityTypes/Types/VendorTrigger.cs b/src/Mercoa.Client/EntityTypes/Types/VendorTrigger.cs index 00cbaf2..84d4714 100644 --- a/src/Mercoa.Client/EntityTypes/Types/VendorTrigger.cs +++ b/src/Mercoa.Client/EntityTypes/Types/VendorTrigger.cs @@ -1,9 +1,11 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class VendorTrigger { [JsonPropertyName("vendorIds")] - public List VendorIds { get; init; } + public IEnumerable VendorIds { get; init; } } diff --git a/src/Mercoa.Client/Fees/FeesClient.cs b/src/Mercoa.Client/Fees/FeesClient.cs index 8ee5daf..a7945a8 100644 --- a/src/Mercoa.Client/Fees/FeesClient.cs +++ b/src/Mercoa.Client/Fees/FeesClient.cs @@ -1,6 +1,8 @@ using System.Text.Json; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class FeesClient @@ -30,6 +32,6 @@ public async Task CalculateAsync(CalculateFeesRequest reque { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } } diff --git a/src/Mercoa.Client/Fees/Types/CalculateFeesRequest.cs b/src/Mercoa.Client/Fees/Types/CalculateFeesRequest.cs index f0709b2..68cfaf7 100644 --- a/src/Mercoa.Client/Fees/Types/CalculateFeesRequest.cs +++ b/src/Mercoa.Client/Fees/Types/CalculateFeesRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class CalculateFeesRequest diff --git a/src/Mercoa.Client/Invoice/Approval/ApprovalClient.cs b/src/Mercoa.Client/Invoice/Approval/ApprovalClient.cs index 921f223..9cf43d7 100644 --- a/src/Mercoa.Client/Invoice/Approval/ApprovalClient.cs +++ b/src/Mercoa.Client/Invoice/Approval/ApprovalClient.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Invoice; public class ApprovalClient diff --git a/src/Mercoa.Client/Invoice/Comment/CommentClient.cs b/src/Mercoa.Client/Invoice/Comment/CommentClient.cs index f4995c8..7d874dc 100644 --- a/src/Mercoa.Client/Invoice/Comment/CommentClient.cs +++ b/src/Mercoa.Client/Invoice/Comment/CommentClient.cs @@ -1,6 +1,8 @@ using System.Text.Json; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Invoice; public class CommentClient @@ -15,7 +17,7 @@ public CommentClient(RawClient client) /// /// Get all comments associated with this invoice /// - public async Task> GetAllAsync() + public async Task> GetAllAsync() { var response = await _client.MakeRequestAsync( new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/comments" } @@ -23,9 +25,9 @@ public async Task> GetAllAsync() string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) { - return JsonSerializer.Deserialize>(responseBody); + return JsonSerializer.Deserialize>(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -46,7 +48,7 @@ public async Task CreateAsync(CommentRequest request) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } public async Task GetAsync(string commentId) @@ -59,7 +61,7 @@ public async Task GetAsync(string commentId) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -80,7 +82,7 @@ public async Task UpdateAsync(string commentId, CommentRequest { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// diff --git a/src/Mercoa.Client/Invoice/Document/DocumentClient.cs b/src/Mercoa.Client/Invoice/Document/DocumentClient.cs index 0ea6770..c67b13a 100644 --- a/src/Mercoa.Client/Invoice/Document/DocumentClient.cs +++ b/src/Mercoa.Client/Invoice/Document/DocumentClient.cs @@ -2,6 +2,8 @@ using Mercoa.Client; using Mercoa.Client.Invoice; +#nullable enable + namespace Mercoa.Client.Invoice; public class DocumentClient @@ -16,7 +18,7 @@ public DocumentClient(RawClient client) /// /// Get attachments (scanned/uploaded PDFs and images) associated with this invoice /// - public async Task> GetAllAsync() + public async Task> GetAllAsync() { var response = await _client.MakeRequestAsync( new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/documents" } @@ -24,9 +26,9 @@ public async Task> GetAllAsync() string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) { - return JsonSerializer.Deserialize>(responseBody); + return JsonSerializer.Deserialize>(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -71,7 +73,7 @@ public async Task GenerateInvoicePdfAsync() { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -87,7 +89,7 @@ public async Task GenerateCheckPdfAsync() { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -103,6 +105,6 @@ public async Task GetSourceEmailAsync() { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } } diff --git a/src/Mercoa.Client/Invoice/Document/requests/UploadDocumentRequest.cs b/src/Mercoa.Client/Invoice/Document/Requests/UploadDocumentRequest.cs similarity index 94% rename from src/Mercoa.Client/Invoice/Document/requests/UploadDocumentRequest.cs rename to src/Mercoa.Client/Invoice/Document/Requests/UploadDocumentRequest.cs index 1e3216d..9060185 100644 --- a/src/Mercoa.Client/Invoice/Document/requests/UploadDocumentRequest.cs +++ b/src/Mercoa.Client/Invoice/Document/Requests/UploadDocumentRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client.Invoice; public class UploadDocumentRequest diff --git a/src/Mercoa.Client/Invoice/InvoiceClient.cs b/src/Mercoa.Client/Invoice/InvoiceClient.cs index 76db543..759b274 100644 --- a/src/Mercoa.Client/Invoice/InvoiceClient.cs +++ b/src/Mercoa.Client/Invoice/InvoiceClient.cs @@ -2,6 +2,8 @@ using Mercoa.Client; using Mercoa.Client.Invoice; +#nullable enable + namespace Mercoa.Client.Invoice; public class InvoiceClient @@ -108,7 +110,7 @@ public async Task FindAsync(GetAllInvoicesRequest request) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } public async Task CreateAsync(InvoiceCreationRequest request) @@ -126,7 +128,7 @@ public async Task CreateAsync(InvoiceCreationRequest request) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } public async Task GetAsync(string invoiceId, GetInvoice request) @@ -149,7 +151,7 @@ public async Task GetAsync(string invoiceId, GetInvoice request { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } public async Task UpdateAsync(string invoiceId, InvoiceUpdateRequest request) @@ -167,7 +169,7 @@ public async Task UpdateAsync(string invoiceId, InvoiceUpdateRe { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// diff --git a/src/Mercoa.Client/Invoice/PaymentLinks/PaymentLinksClient.cs b/src/Mercoa.Client/Invoice/PaymentLinks/PaymentLinksClient.cs index cf5b40e..1cba76a 100644 --- a/src/Mercoa.Client/Invoice/PaymentLinks/PaymentLinksClient.cs +++ b/src/Mercoa.Client/Invoice/PaymentLinks/PaymentLinksClient.cs @@ -2,6 +2,8 @@ using Mercoa.Client; using Mercoa.Client.Invoice; +#nullable enable + namespace Mercoa.Client.Invoice; public class PaymentLinksClient @@ -26,7 +28,7 @@ public async Task GetPayerLinkAsync() { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -62,7 +64,7 @@ public async Task GetVendorLinkAsync() { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// diff --git a/src/Mercoa.Client/Invoice/PaymentLinks/requests/SendPayerEmail.cs b/src/Mercoa.Client/Invoice/PaymentLinks/Requests/SendPayerEmail.cs similarity index 100% rename from src/Mercoa.Client/Invoice/PaymentLinks/requests/SendPayerEmail.cs rename to src/Mercoa.Client/Invoice/PaymentLinks/Requests/SendPayerEmail.cs diff --git a/src/Mercoa.Client/Invoice/requests/GetAllInvoicesRequest.cs b/src/Mercoa.Client/Invoice/Requests/GetAllInvoicesRequest.cs similarity index 99% rename from src/Mercoa.Client/Invoice/requests/GetAllInvoicesRequest.cs rename to src/Mercoa.Client/Invoice/Requests/GetAllInvoicesRequest.cs index b44cb4e..e877867 100644 --- a/src/Mercoa.Client/Invoice/requests/GetAllInvoicesRequest.cs +++ b/src/Mercoa.Client/Invoice/Requests/GetAllInvoicesRequest.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Invoice; public class GetAllInvoicesRequest diff --git a/src/Mercoa.Client/Invoice/requests/GetInvoice.cs b/src/Mercoa.Client/Invoice/Requests/GetInvoice.cs similarity index 100% rename from src/Mercoa.Client/Invoice/requests/GetInvoice.cs rename to src/Mercoa.Client/Invoice/Requests/GetInvoice.cs diff --git a/src/Mercoa.Client/InvoiceTypes/InvoiceTypesClient.cs b/src/Mercoa.Client/InvoiceTypes/InvoiceTypesClient.cs index 2ee495a..b59d643 100644 --- a/src/Mercoa.Client/InvoiceTypes/InvoiceTypesClient.cs +++ b/src/Mercoa.Client/InvoiceTypes/InvoiceTypesClient.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class InvoiceTypesClient diff --git a/src/Mercoa.Client/InvoiceTypes/Types/AddApproverRequest.cs b/src/Mercoa.Client/InvoiceTypes/Types/AddApproverRequest.cs index 60b2aa1..05d9bc4 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/AddApproverRequest.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/AddApproverRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class AddApproverRequest diff --git a/src/Mercoa.Client/InvoiceTypes/Types/ApprovalRequest.cs b/src/Mercoa.Client/InvoiceTypes/Types/ApprovalRequest.cs index 9358b2c..eca7c68 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/ApprovalRequest.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/ApprovalRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class ApprovalRequest diff --git a/src/Mercoa.Client/InvoiceTypes/Types/ApprovalSlot.cs b/src/Mercoa.Client/InvoiceTypes/Types/ApprovalSlot.cs index a7dd0ee..32d0a1c 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/ApprovalSlot.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/ApprovalSlot.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class ApprovalSlot @@ -24,10 +26,10 @@ public class ApprovalSlot public ApproverAction Action { get; init; } [JsonPropertyName("eligibleRoles")] - public List EligibleRoles { get; init; } + public IEnumerable EligibleRoles { get; init; } [JsonPropertyName("eligibleUserIds")] - public List EligibleUserIds { get; init; } + public IEnumerable EligibleUserIds { get; init; } /// /// Either the date the invoice was created, date the approver was assigned, or date of last action by approver, whichever is latest. diff --git a/src/Mercoa.Client/InvoiceTypes/Types/ApprovalSlotAssignment.cs b/src/Mercoa.Client/InvoiceTypes/Types/ApprovalSlotAssignment.cs index 2ff46fb..124a881 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/ApprovalSlotAssignment.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/ApprovalSlotAssignment.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class ApprovalSlotAssignment diff --git a/src/Mercoa.Client/InvoiceTypes/Types/ApproverAction.cs b/src/Mercoa.Client/InvoiceTypes/Types/ApproverAction.cs index 76fe835..d7b62f7 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/ApproverAction.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/ApproverAction.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum ApproverAction { [EnumMember(Value = "NONE")] diff --git a/src/Mercoa.Client/InvoiceTypes/Types/AssociatedApprovalAction.cs b/src/Mercoa.Client/InvoiceTypes/Types/AssociatedApprovalAction.cs index b4cb5e5..887bb97 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/AssociatedApprovalAction.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/AssociatedApprovalAction.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class AssociatedApprovalAction diff --git a/src/Mercoa.Client/InvoiceTypes/Types/BankAccountPaymentDestinationOptions.cs b/src/Mercoa.Client/InvoiceTypes/Types/BankAccountPaymentDestinationOptions.cs index 534e71b..e2b4c75 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/BankAccountPaymentDestinationOptions.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/BankAccountPaymentDestinationOptions.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class BankAccountPaymentDestinationOptions diff --git a/src/Mercoa.Client/InvoiceTypes/Types/BankDeliveryMethod.cs b/src/Mercoa.Client/InvoiceTypes/Types/BankDeliveryMethod.cs index 1b2b1c6..bfe8d98 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/BankDeliveryMethod.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/BankDeliveryMethod.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum BankDeliveryMethod { [EnumMember(Value = "ACH_STANDARD")] diff --git a/src/Mercoa.Client/InvoiceTypes/Types/CheckDeliveryMethod.cs b/src/Mercoa.Client/InvoiceTypes/Types/CheckDeliveryMethod.cs index eff1609..278862e 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/CheckDeliveryMethod.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/CheckDeliveryMethod.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum CheckDeliveryMethod { [EnumMember(Value = "PRINT")] diff --git a/src/Mercoa.Client/InvoiceTypes/Types/CheckPaymentDestinationOptions.cs b/src/Mercoa.Client/InvoiceTypes/Types/CheckPaymentDestinationOptions.cs index 8b7342f..eb85fad 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/CheckPaymentDestinationOptions.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/CheckPaymentDestinationOptions.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class CheckPaymentDestinationOptions diff --git a/src/Mercoa.Client/InvoiceTypes/Types/CommentRequest.cs b/src/Mercoa.Client/InvoiceTypes/Types/CommentRequest.cs index a696de3..7dae15c 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/CommentRequest.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/CommentRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class CommentRequest diff --git a/src/Mercoa.Client/InvoiceTypes/Types/CommentResponse.cs b/src/Mercoa.Client/InvoiceTypes/Types/CommentResponse.cs index 602685c..52ff45d 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/CommentResponse.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/CommentResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class CommentResponse diff --git a/src/Mercoa.Client/InvoiceTypes/Types/DocumentResponse.cs b/src/Mercoa.Client/InvoiceTypes/Types/DocumentResponse.cs index 18898e6..62a4532 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/DocumentResponse.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/DocumentResponse.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class DocumentResponse diff --git a/src/Mercoa.Client/InvoiceTypes/Types/FindInvoiceResponse.cs b/src/Mercoa.Client/InvoiceTypes/Types/FindInvoiceResponse.cs index c32f500..b0fe3ae 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/FindInvoiceResponse.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/FindInvoiceResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class FindInvoiceResponse @@ -18,5 +20,5 @@ public class FindInvoiceResponse public bool HasMore { get; init; } [JsonPropertyName("data")] - public List Data { get; init; } + public IEnumerable Data { get; init; } } diff --git a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceCreationRequest.cs b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceCreationRequest.cs index 7a1b868..5351af0 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceCreationRequest.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceCreationRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class InvoiceCreationRequest @@ -93,10 +95,10 @@ public class InvoiceCreationRequest /// Set approvers for this invoice. /// [JsonPropertyName("approvers")] - public List? Approvers { get; init; } + public IEnumerable? Approvers { get; init; } [JsonPropertyName("lineItems")] - public List? LineItems { get; init; } + public IEnumerable? LineItems { get; init; } /// /// Metadata associated with this invoice. You can specify up to 10 keys, with key names up to 40 characters long and values up to 200 characters long. diff --git a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceFailureType.cs b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceFailureType.cs index 0b21f16..afa6988 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceFailureType.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceFailureType.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum InvoiceFailureType { [EnumMember(Value = "SOURCE_PAYMENT_ERROR")] diff --git a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceFeesResponse.cs b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceFeesResponse.cs index 4084144..42c806a 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceFeesResponse.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceFeesResponse.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class InvoiceFeesResponse diff --git a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceLineItemRequest.cs b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceLineItemRequest.cs index b24ea13..1e37ba9 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceLineItemRequest.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceLineItemRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class InvoiceLineItemRequest diff --git a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceLineItemResponse.cs b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceLineItemResponse.cs index 9f7e03a..6043faf 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceLineItemResponse.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceLineItemResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class InvoiceLineItemResponse diff --git a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceMetadataFilter.cs b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceMetadataFilter.cs index 4f3ec32..acf6ef2 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceMetadataFilter.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceMetadataFilter.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class InvoiceMetadataFilter diff --git a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceMetricsPerDateGroupBy.cs b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceMetricsPerDateGroupBy.cs index 49d72a9..fb19440 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceMetricsPerDateGroupBy.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceMetricsPerDateGroupBy.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum InvoiceMetricsPerDateGroupBy { [EnumMember(Value = "CREATION_DATE")] diff --git a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceMetricsPerDateResponse.cs b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceMetricsPerDateResponse.cs index bda17ad..e2cc87f 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceMetricsPerDateResponse.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceMetricsPerDateResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class InvoiceMetricsPerDateResponse diff --git a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceMetricsResponse.cs b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceMetricsResponse.cs index 1894a70..9ab2cd2 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceMetricsResponse.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceMetricsResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class InvoiceMetricsResponse diff --git a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceOrderByField.cs b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceOrderByField.cs index 96d1ce6..f989f07 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceOrderByField.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceOrderByField.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum InvoiceOrderByField { [EnumMember(Value = "AMOUNT")] diff --git a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceRequestBase.cs b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceRequestBase.cs index af16a89..58d7946 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceRequestBase.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceRequestBase.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class InvoiceRequestBase @@ -87,10 +89,10 @@ public class InvoiceRequestBase /// Set approvers for this invoice. /// [JsonPropertyName("approvers")] - public List? Approvers { get; init; } + public IEnumerable? Approvers { get; init; } [JsonPropertyName("lineItems")] - public List? LineItems { get; init; } + public IEnumerable? LineItems { get; init; } /// /// Metadata associated with this invoice. You can specify up to 10 keys, with key names up to 40 characters long and values up to 200 characters long. diff --git a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceResponse.cs b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceResponse.cs index 237d3d0..29930ac 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceResponse.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class InvoiceResponse @@ -105,16 +107,16 @@ public class InvoiceResponse public bool HasSourceEmail { get; init; } [JsonPropertyName("comments")] - public List? Comments { get; init; } + public IEnumerable? Comments { get; init; } [JsonPropertyName("lineItems")] - public List? LineItems { get; init; } + public IEnumerable? LineItems { get; init; } [JsonPropertyName("approvers")] - public List Approvers { get; init; } + public IEnumerable Approvers { get; init; } [JsonPropertyName("approvalPolicy")] - public List ApprovalPolicy { get; init; } + public IEnumerable ApprovalPolicy { get; init; } /// /// Metadata associated with this invoice. diff --git a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceStatus.cs b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceStatus.cs index 68245ca..f3bf259 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceStatus.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceStatus.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum InvoiceStatus { [EnumMember(Value = "DRAFT")] diff --git a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceUpdateRequest.cs b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceUpdateRequest.cs index 1b0d885..abbf42a 100644 --- a/src/Mercoa.Client/InvoiceTypes/Types/InvoiceUpdateRequest.cs +++ b/src/Mercoa.Client/InvoiceTypes/Types/InvoiceUpdateRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class InvoiceUpdateRequest @@ -93,10 +95,10 @@ public class InvoiceUpdateRequest /// Set approvers for this invoice. /// [JsonPropertyName("approvers")] - public List? Approvers { get; init; } + public IEnumerable? Approvers { get; init; } [JsonPropertyName("lineItems")] - public List? LineItems { get; init; } + public IEnumerable? LineItems { get; init; } /// /// Metadata associated with this invoice. You can specify up to 10 keys, with key names up to 40 characters long and values up to 200 characters long. diff --git a/src/Mercoa.Client/Mercoa.Client.csproj b/src/Mercoa.Client/Mercoa.Client.csproj index 74ca5a8..7277d71 100644 --- a/src/Mercoa.Client/Mercoa.Client.csproj +++ b/src/Mercoa.Client/Mercoa.Client.csproj @@ -2,10 +2,10 @@ - net7.0 + net8.0;net7.0;net6.0 enable false - v0.3.37 + v0.3.38 README.md https://github.com/mercoa-finance/csharp diff --git a/src/Mercoa.Client/Mercoa.cs b/src/Mercoa.Client/Mercoa.cs index f145196..d7d1c8e 100644 --- a/src/Mercoa.Client/Mercoa.cs +++ b/src/Mercoa.Client/Mercoa.cs @@ -3,6 +3,8 @@ using Mercoa.Client.Invoice; using Mercoa.Client.Organization; +#nullable enable + namespace Mercoa.Client; public partial class Mercoa @@ -17,7 +19,7 @@ public Mercoa(string token = null, ClientOptions clientOptions = null) { "Authorization", $"Bearer {token}" }, { "X-Fern-Language", "C#" }, { "X-Fern-SDK-Name", "Mercoa.Client" }, - { "X-Fern-SDK-Version", "v0.3.37" }, + { "X-Fern-SDK-Version", "v0.3.38" }, }, clientOptions ?? new ClientOptions() ); diff --git a/src/Mercoa.Client/Ocr/OcrClient.cs b/src/Mercoa.Client/Ocr/OcrClient.cs index 44dc742..460bf93 100644 --- a/src/Mercoa.Client/Ocr/OcrClient.cs +++ b/src/Mercoa.Client/Ocr/OcrClient.cs @@ -1,6 +1,8 @@ using System.Text.Json; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class OcrClient @@ -30,7 +32,7 @@ public async Task OcrAsync(OcrRequest request) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -51,7 +53,7 @@ public async Task RunAsyncOcrAsync(OcrRequest request) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -67,6 +69,6 @@ public async Task GetAsyncOcrAsync(string jobId) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } } diff --git a/src/Mercoa.Client/Ocr/Types/OcrAsyncResponse.cs b/src/Mercoa.Client/Ocr/Types/OcrAsyncResponse.cs index ff401f2..5f7994b 100644 --- a/src/Mercoa.Client/Ocr/Types/OcrAsyncResponse.cs +++ b/src/Mercoa.Client/Ocr/Types/OcrAsyncResponse.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class OcrAsyncResponse diff --git a/src/Mercoa.Client/Ocr/Types/OcrJobResponse.cs b/src/Mercoa.Client/Ocr/Types/OcrJobResponse.cs index 5869473..4e4fcc2 100644 --- a/src/Mercoa.Client/Ocr/Types/OcrJobResponse.cs +++ b/src/Mercoa.Client/Ocr/Types/OcrJobResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class OcrJobResponse diff --git a/src/Mercoa.Client/Ocr/Types/OcrJobStatus.cs b/src/Mercoa.Client/Ocr/Types/OcrJobStatus.cs index ec1fbb5..2d01249 100644 --- a/src/Mercoa.Client/Ocr/Types/OcrJobStatus.cs +++ b/src/Mercoa.Client/Ocr/Types/OcrJobStatus.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum OcrJobStatus { [EnumMember(Value = "pending")] diff --git a/src/Mercoa.Client/Ocr/Types/OcrRequest.cs b/src/Mercoa.Client/Ocr/Types/OcrRequest.cs index 877fa20..238ca16 100644 --- a/src/Mercoa.Client/Ocr/Types/OcrRequest.cs +++ b/src/Mercoa.Client/Ocr/Types/OcrRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class OcrRequest diff --git a/src/Mercoa.Client/Ocr/Types/OcrResponse.cs b/src/Mercoa.Client/Ocr/Types/OcrResponse.cs index e913407..aa8d677 100644 --- a/src/Mercoa.Client/Ocr/Types/OcrResponse.cs +++ b/src/Mercoa.Client/Ocr/Types/OcrResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class OcrResponse diff --git a/src/Mercoa.Client/Organization/NotificationConfiguration/NotificationConfigurationClient.cs b/src/Mercoa.Client/Organization/NotificationConfiguration/NotificationConfigurationClient.cs index 790dd8c..f7daa88 100644 --- a/src/Mercoa.Client/Organization/NotificationConfiguration/NotificationConfigurationClient.cs +++ b/src/Mercoa.Client/Organization/NotificationConfiguration/NotificationConfigurationClient.cs @@ -1,6 +1,8 @@ using System.Text.Json; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client.Organization; public class NotificationConfigurationClient @@ -15,7 +17,7 @@ public NotificationConfigurationClient(RawClient client) /// /// Retrieve all notification configurations /// - public async Task> GetAllAsync() + public async Task> GetAllAsync() { var response = await _client.MakeRequestAsync( new RawClient.ApiRequest @@ -27,11 +29,11 @@ public async Task> GetAllAsync() string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) { - return JsonSerializer.Deserialize>( + return JsonSerializer.Deserialize>( responseBody ); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -51,7 +53,7 @@ public async Task GetAsync(NotificationType n { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -75,7 +77,7 @@ NotificationConfigurationRequest request { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// diff --git a/src/Mercoa.Client/Organization/OrganizationClient.cs b/src/Mercoa.Client/Organization/OrganizationClient.cs index a7d1667..55bd678 100644 --- a/src/Mercoa.Client/Organization/OrganizationClient.cs +++ b/src/Mercoa.Client/Organization/OrganizationClient.cs @@ -2,6 +2,8 @@ using Mercoa.Client; using Mercoa.Client.Organization; +#nullable enable + namespace Mercoa.Client.Organization; public class OrganizationClient @@ -63,7 +65,7 @@ public async Task GetAsync(GetOrganizationRequest request) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -84,7 +86,7 @@ public async Task UpdateAsync(OrganizationRequest request) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } /// @@ -122,6 +124,6 @@ public async Task EmailLogAsync(GetEmailLogRequest request) { return JsonSerializer.Deserialize(responseBody); } - throw new Exception(); + throw new Exception(responseBody); } } diff --git a/src/Mercoa.Client/Organization/requests/GetEmailLogRequest.cs b/src/Mercoa.Client/Organization/Requests/GetEmailLogRequest.cs similarity index 100% rename from src/Mercoa.Client/Organization/requests/GetEmailLogRequest.cs rename to src/Mercoa.Client/Organization/Requests/GetEmailLogRequest.cs diff --git a/src/Mercoa.Client/Organization/requests/GetOrganizationRequest.cs b/src/Mercoa.Client/Organization/Requests/GetOrganizationRequest.cs similarity index 100% rename from src/Mercoa.Client/Organization/requests/GetOrganizationRequest.cs rename to src/Mercoa.Client/Organization/Requests/GetOrganizationRequest.cs diff --git a/src/Mercoa.Client/OrganizationTypes/OrganizationTypesClient.cs b/src/Mercoa.Client/OrganizationTypes/OrganizationTypesClient.cs index afe8be8..5d87695 100644 --- a/src/Mercoa.Client/OrganizationTypes/OrganizationTypesClient.cs +++ b/src/Mercoa.Client/OrganizationTypes/OrganizationTypesClient.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class OrganizationTypesClient diff --git a/src/Mercoa.Client/OrganizationTypes/Types/BusinessOnboardingOptions.cs b/src/Mercoa.Client/OrganizationTypes/Types/BusinessOnboardingOptions.cs index 81dba9b..32d535c 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/BusinessOnboardingOptions.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/BusinessOnboardingOptions.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class BusinessOnboardingOptions diff --git a/src/Mercoa.Client/OrganizationTypes/Types/CodatProviderRequest.cs b/src/Mercoa.Client/OrganizationTypes/Types/CodatProviderRequest.cs index 58418ee..745220f 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/CodatProviderRequest.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/CodatProviderRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class CodatProviderRequest diff --git a/src/Mercoa.Client/OrganizationTypes/Types/CodatProviderResponse.cs b/src/Mercoa.Client/OrganizationTypes/Types/CodatProviderResponse.cs index d0c3732..94e165e 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/CodatProviderResponse.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/CodatProviderResponse.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class CodatProviderResponse diff --git a/src/Mercoa.Client/OrganizationTypes/Types/ColorSchemeRequest.cs b/src/Mercoa.Client/OrganizationTypes/Types/ColorSchemeRequest.cs index e0f3c50..d0f15e5 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/ColorSchemeRequest.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/ColorSchemeRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class ColorSchemeRequest diff --git a/src/Mercoa.Client/OrganizationTypes/Types/ColorSchemeResponse.cs b/src/Mercoa.Client/OrganizationTypes/Types/ColorSchemeResponse.cs index 899e015..f3923aa 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/ColorSchemeResponse.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/ColorSchemeResponse.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class ColorSchemeResponse diff --git a/src/Mercoa.Client/OrganizationTypes/Types/EmailProviderRequest.cs b/src/Mercoa.Client/OrganizationTypes/Types/EmailProviderRequest.cs index 10ab601..39a4e22 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/EmailProviderRequest.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/EmailProviderRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class EmailProviderRequest diff --git a/src/Mercoa.Client/OrganizationTypes/Types/EmailProviderResponse.cs b/src/Mercoa.Client/OrganizationTypes/Types/EmailProviderResponse.cs index 3398077..afcde86 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/EmailProviderResponse.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/EmailProviderResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class EmailProviderResponse diff --git a/src/Mercoa.Client/OrganizationTypes/Types/EmailSenderProvider.cs b/src/Mercoa.Client/OrganizationTypes/Types/EmailSenderProvider.cs index efc075f..4b2e76f 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/EmailSenderProvider.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/EmailSenderProvider.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum EmailSenderProvider { [EnumMember(Value = "none")] diff --git a/src/Mercoa.Client/OrganizationTypes/Types/EmailSenderRequest.cs b/src/Mercoa.Client/OrganizationTypes/Types/EmailSenderRequest.cs index ff0482a..7d20767 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/EmailSenderRequest.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/EmailSenderRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class EmailSenderRequest diff --git a/src/Mercoa.Client/OrganizationTypes/Types/EmailSenderResponse.cs b/src/Mercoa.Client/OrganizationTypes/Types/EmailSenderResponse.cs index 4370607..42b4116 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/EmailSenderResponse.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/EmailSenderResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class EmailSenderResponse diff --git a/src/Mercoa.Client/OrganizationTypes/Types/IndividualOnboardingOptions.cs b/src/Mercoa.Client/OrganizationTypes/Types/IndividualOnboardingOptions.cs index d6d87f3..1cebf79 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/IndividualOnboardingOptions.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/IndividualOnboardingOptions.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class IndividualOnboardingOptions diff --git a/src/Mercoa.Client/OrganizationTypes/Types/InvoiceNotificationConfigurationRequest.cs b/src/Mercoa.Client/OrganizationTypes/Types/InvoiceNotificationConfigurationRequest.cs index d3459f7..462b6d4 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/InvoiceNotificationConfigurationRequest.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/InvoiceNotificationConfigurationRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class InvoiceNotificationConfigurationRequest diff --git a/src/Mercoa.Client/OrganizationTypes/Types/InvoiceNotificationConfigurationResponse.cs b/src/Mercoa.Client/OrganizationTypes/Types/InvoiceNotificationConfigurationResponse.cs index b9065e4..522db5e 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/InvoiceNotificationConfigurationResponse.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/InvoiceNotificationConfigurationResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class InvoiceNotificationConfigurationResponse diff --git a/src/Mercoa.Client/OrganizationTypes/Types/MetadataRegexValidationRule.cs b/src/Mercoa.Client/OrganizationTypes/Types/MetadataRegexValidationRule.cs index 5ab2d4f..ef63caf 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/MetadataRegexValidationRule.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/MetadataRegexValidationRule.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class MetadataRegexValidationRule diff --git a/src/Mercoa.Client/OrganizationTypes/Types/MetadataSchema.cs b/src/Mercoa.Client/OrganizationTypes/Types/MetadataSchema.cs index 87953cd..f1de0b7 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/MetadataSchema.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/MetadataSchema.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class MetadataSchema diff --git a/src/Mercoa.Client/OrganizationTypes/Types/MetadataShowConditions.cs b/src/Mercoa.Client/OrganizationTypes/Types/MetadataShowConditions.cs index d7a3f16..a7fdb1c 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/MetadataShowConditions.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/MetadataShowConditions.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class MetadataShowConditions @@ -27,23 +29,23 @@ public class MetadataShowConditions /// Show this field only if the payment source type is in this list. /// [JsonPropertyName("paymentSourceTypes")] - public List? PaymentSourceTypes { get; init; } + public IEnumerable? PaymentSourceTypes { get; init; } /// /// Show this field only if the payment source schema ID is in this list of payment source schema IDs. This is only applicable if paymentSourceTypes contains CUSTOM. /// [JsonPropertyName("paymentSourceCustomSchemaIds")] - public List? PaymentSourceCustomSchemaIds { get; init; } + public IEnumerable? PaymentSourceCustomSchemaIds { get; init; } /// /// Show this field only if the payment destination type is in this list. /// [JsonPropertyName("paymentDestinationTypes")] - public List? PaymentDestinationTypes { get; init; } + public IEnumerable? PaymentDestinationTypes { get; init; } /// /// Show this field only if the payment destination schema ID is in this list of payment destination schema IDs. This is only applicable if paymentDestinationTypes contains CUSTOM. /// [JsonPropertyName("paymentDestinationCustomSchemaIds")] - public List? PaymentDestinationCustomSchemaIds { get; init; } + public IEnumerable? PaymentDestinationCustomSchemaIds { get; init; } } diff --git a/src/Mercoa.Client/OrganizationTypes/Types/MetadataType.cs b/src/Mercoa.Client/OrganizationTypes/Types/MetadataType.cs index ec580f5..aa2622f 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/MetadataType.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/MetadataType.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum MetadataType { [EnumMember(Value = "STRING")] diff --git a/src/Mercoa.Client/OrganizationTypes/Types/OnboardingOption.cs b/src/Mercoa.Client/OrganizationTypes/Types/OnboardingOption.cs index 4a1f293..3986293 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/OnboardingOption.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/OnboardingOption.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class OnboardingOption diff --git a/src/Mercoa.Client/OrganizationTypes/Types/OnboardingOptionsRequest.cs b/src/Mercoa.Client/OrganizationTypes/Types/OnboardingOptionsRequest.cs index 218f9da..1fca5b0 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/OnboardingOptionsRequest.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/OnboardingOptionsRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class OnboardingOptionsRequest diff --git a/src/Mercoa.Client/OrganizationTypes/Types/OnboardingOptionsResponse.cs b/src/Mercoa.Client/OrganizationTypes/Types/OnboardingOptionsResponse.cs index 9b14ea8..6d230d6 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/OnboardingOptionsResponse.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/OnboardingOptionsResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class OnboardingOptionsResponse diff --git a/src/Mercoa.Client/OrganizationTypes/Types/OrganizationRequest.cs b/src/Mercoa.Client/OrganizationTypes/Types/OrganizationRequest.cs index ac43e6e..9bde7c6 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/OrganizationRequest.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/OrganizationRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class OrganizationRequest @@ -36,5 +38,5 @@ public class OrganizationRequest public OnboardingOptionsRequest? PayorOnboardingOptions { get; init; } [JsonPropertyName("metadataSchema")] - public List? MetadataSchema { get; init; } + public IEnumerable? MetadataSchema { get; init; } } diff --git a/src/Mercoa.Client/OrganizationTypes/Types/OrganizationResponse.cs b/src/Mercoa.Client/OrganizationTypes/Types/OrganizationResponse.cs index f8a1db8..8e07384 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/OrganizationResponse.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/OrganizationResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class OrganizationResponse @@ -42,5 +44,5 @@ public class OrganizationResponse public OnboardingOptionsResponse? PayorOnboardingOptions { get; init; } [JsonPropertyName("metadataSchema")] - public List? MetadataSchema { get; init; } + public IEnumerable? MetadataSchema { get; init; } } diff --git a/src/Mercoa.Client/OrganizationTypes/Types/PaymentMethodsRequest.cs b/src/Mercoa.Client/OrganizationTypes/Types/PaymentMethodsRequest.cs index 32c0f92..aa13b76 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/PaymentMethodsRequest.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/PaymentMethodsRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class PaymentMethodsRequest @@ -9,17 +11,17 @@ public class PaymentMethodsRequest /// List of payment methods that can be used to pay invoices. /// [JsonPropertyName("payerPayments")] - public List PayerPayments { get; init; } + public IEnumerable PayerPayments { get; init; } /// /// List of payment methods that can be created by a payor to send disbursements. /// [JsonPropertyName("backupDisbursements")] - public List BackupDisbursements { get; init; } + public IEnumerable BackupDisbursements { get; init; } /// /// List of payment methods that can be created by a payee to receive disbursements. /// [JsonPropertyName("vendorDisbursements")] - public List VendorDisbursements { get; init; } + public IEnumerable VendorDisbursements { get; init; } } diff --git a/src/Mercoa.Client/OrganizationTypes/Types/PaymentMethodsResponse.cs b/src/Mercoa.Client/OrganizationTypes/Types/PaymentMethodsResponse.cs index 63dd64d..e398fbb 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/PaymentMethodsResponse.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/PaymentMethodsResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class PaymentMethodsResponse @@ -9,17 +11,17 @@ public class PaymentMethodsResponse /// List of payment methods that can be used to pay invoices. /// [JsonPropertyName("payerPayments")] - public List PayerPayments { get; init; } + public IEnumerable PayerPayments { get; init; } /// /// List of payment methods that can be created by a payor to send disbursements. /// [JsonPropertyName("backupDisbursements")] - public List BackupDisbursements { get; init; } + public IEnumerable BackupDisbursements { get; init; } /// /// List of payment methods that can be created by a payee to receive disbursements. /// [JsonPropertyName("vendorDisbursements")] - public List VendorDisbursements { get; init; } + public IEnumerable VendorDisbursements { get; init; } } diff --git a/src/Mercoa.Client/OrganizationTypes/Types/PaymentRailRequest.cs b/src/Mercoa.Client/OrganizationTypes/Types/PaymentRailRequest.cs index 7c69a34..29f1694 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/PaymentRailRequest.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/PaymentRailRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class PaymentRailRequest diff --git a/src/Mercoa.Client/OrganizationTypes/Types/PaymentRailResponse.cs b/src/Mercoa.Client/OrganizationTypes/Types/PaymentRailResponse.cs index 40e6e7f..fc0b809 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/PaymentRailResponse.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/PaymentRailResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class PaymentRailResponse @@ -16,4 +18,10 @@ public class PaymentRailResponse [JsonPropertyName("active")] public bool Active { get; init; } + + /// + /// unused + /// + [JsonPropertyName("available")] + public bool? Available { get; init; } } diff --git a/src/Mercoa.Client/OrganizationTypes/Types/RutterProviderRequest.cs b/src/Mercoa.Client/OrganizationTypes/Types/RutterProviderRequest.cs index 1234580..b8dc839 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/RutterProviderRequest.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/RutterProviderRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class RutterProviderRequest diff --git a/src/Mercoa.Client/OrganizationTypes/Types/RutterProviderResponse.cs b/src/Mercoa.Client/OrganizationTypes/Types/RutterProviderResponse.cs index 773149c..24a66dd 100644 --- a/src/Mercoa.Client/OrganizationTypes/Types/RutterProviderResponse.cs +++ b/src/Mercoa.Client/OrganizationTypes/Types/RutterProviderResponse.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class RutterProviderResponse diff --git a/src/Mercoa.Client/PaymentMethodTypes/PaymentMethodTypesClient.cs b/src/Mercoa.Client/PaymentMethodTypes/PaymentMethodTypesClient.cs index d65bc50..244ea9b 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/PaymentMethodTypesClient.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/PaymentMethodTypesClient.cs @@ -1,5 +1,7 @@ using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class PaymentMethodTypesClient diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/BankAccountCheckOptions.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/BankAccountCheckOptions.cs index 68ece6c..afa6c40 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/BankAccountCheckOptions.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/BankAccountCheckOptions.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class BankAccountCheckOptions diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/BankAccountRequest.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/BankAccountRequest.cs index 7d8cfe3..0e1b2fa 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/BankAccountRequest.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/BankAccountRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class BankAccountRequest diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/BankAccountResponse.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/BankAccountResponse.cs index f8400b7..945f968 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/BankAccountResponse.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/BankAccountResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class BankAccountResponse @@ -45,7 +47,7 @@ public class BankAccountResponse public bool IsDefaultDestination { get; init; } [JsonPropertyName("supportedCurrencies")] - public List SupportedCurrencies { get; init; } + public IEnumerable SupportedCurrencies { get; init; } [JsonPropertyName("createdAt")] public DateTime CreatedAt { get; init; } diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/BankAccountUpdateRequest.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/BankAccountUpdateRequest.cs index 311e8ea..cc047e8 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/BankAccountUpdateRequest.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/BankAccountUpdateRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class BankAccountUpdateRequest diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/BankStatus.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/BankStatus.cs index 45e021d..9b11d98 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/BankStatus.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/BankStatus.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum BankStatus { [EnumMember(Value = "NEW")] diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/BankType.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/BankType.cs index 7e74075..a78480d 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/BankType.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/BankType.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum BankType { [EnumMember(Value = "CHECKING")] diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/CardBrand.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/CardBrand.cs index a611ec1..84cef5d 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/CardBrand.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/CardBrand.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum CardBrand { [EnumMember(Value = "AmericanExpress")] diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/CardRequest.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/CardRequest.cs index fd8d8e7..5bb3871 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/CardRequest.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/CardRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class CardRequest diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/CardResponse.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/CardResponse.cs index f2f2205..75200ba 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/CardResponse.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/CardResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class CardResponse @@ -36,7 +38,7 @@ public class CardResponse public bool IsDefaultDestination { get; init; } [JsonPropertyName("supportedCurrencies")] - public List SupportedCurrencies { get; init; } + public IEnumerable SupportedCurrencies { get; init; } [JsonPropertyName("createdAt")] public DateTime CreatedAt { get; init; } diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/CardType.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/CardType.cs index a540a7b..82656d6 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/CardType.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/CardType.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum CardType { [EnumMember(Value = "credit")] diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/CheckRequest.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/CheckRequest.cs index 57193f0..5a50364 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/CheckRequest.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/CheckRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class CheckRequest diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/CheckResponse.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/CheckResponse.cs index fb77659..e80331b 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/CheckResponse.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/CheckResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class CheckResponse @@ -42,7 +44,7 @@ public class CheckResponse public bool IsDefaultDestination { get; init; } [JsonPropertyName("supportedCurrencies")] - public List SupportedCurrencies { get; init; } + public IEnumerable SupportedCurrencies { get; init; } [JsonPropertyName("createdAt")] public DateTime CreatedAt { get; init; } diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/CurrencyCode.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/CurrencyCode.cs index acd45a7..ccb9c27 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/CurrencyCode.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/CurrencyCode.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum CurrencyCode { [EnumMember(Value = "AED")] diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodRequest.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodRequest.cs index ecfdf33..108ee48 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodRequest.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class CustomPaymentMethodRequest diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodResponse.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodResponse.cs index 678de6f..67db3ae 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodResponse.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class CustomPaymentMethodResponse @@ -48,7 +50,7 @@ public class CustomPaymentMethodResponse public bool IsDefaultDestination { get; init; } [JsonPropertyName("supportedCurrencies")] - public List SupportedCurrencies { get; init; } + public IEnumerable SupportedCurrencies { get; init; } [JsonPropertyName("createdAt")] public DateTime CreatedAt { get; init; } diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodSchemaField.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodSchemaField.cs index 66db9dd..442a0ac 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodSchemaField.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodSchemaField.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class CustomPaymentMethodSchemaField @@ -36,5 +38,5 @@ public class CustomPaymentMethodSchemaField /// When type is 'select', provide options that can be selected /// [JsonPropertyName("options")] - public List? Options { get; init; } + public IEnumerable? Options { get; init; } } diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodSchemaFieldType.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodSchemaFieldType.cs index 3c38f45..6ad7b79 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodSchemaFieldType.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodSchemaFieldType.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum CustomPaymentMethodSchemaFieldType { [EnumMember(Value = "text")] diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodSchemaRequest.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodSchemaRequest.cs index be12c8c..232b87a 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodSchemaRequest.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodSchemaRequest.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class CustomPaymentMethodSchemaRequest @@ -24,8 +26,8 @@ public class CustomPaymentMethodSchemaRequest /// List of currencies that this payment method supports. If not provided, the payment method will support only USD. /// [JsonPropertyName("supportedCurrencies")] - public List? SupportedCurrencies { get; init; } + public IEnumerable? SupportedCurrencies { get; init; } [JsonPropertyName("fields")] - public List Fields { get; init; } + public IEnumerable Fields { get; init; } } diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodSchemaResponse.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodSchemaResponse.cs index e82ee11..a49dfb6 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodSchemaResponse.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodSchemaResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class CustomPaymentMethodSchemaResponse @@ -27,10 +29,10 @@ public class CustomPaymentMethodSchemaResponse /// List of currencies that this payment method supports. /// [JsonPropertyName("supportedCurrencies")] - public List SupportedCurrencies { get; init; } + public IEnumerable SupportedCurrencies { get; init; } [JsonPropertyName("fields")] - public List Fields { get; init; } + public IEnumerable Fields { get; init; } [JsonPropertyName("createdAt")] public DateTime CreatedAt { get; init; } diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodUpdateRequest.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodUpdateRequest.cs index ee7edae..dc0667a 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodUpdateRequest.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/CustomPaymentMethodUpdateRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class CustomPaymentMethodUpdateRequest diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodBalanceResponse.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodBalanceResponse.cs index 73442dd..f23c6ab 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodBalanceResponse.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodBalanceResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class PaymentMethodBalanceResponse diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodBalanceStatus.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodBalanceStatus.cs index acf2186..c3761a4 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodBalanceStatus.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodBalanceStatus.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum PaymentMethodBalanceStatus { [EnumMember(Value = "AVAILABLE")] diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodBaseRequest.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodBaseRequest.cs index 24de413..9a86f54 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodBaseRequest.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodBaseRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class PaymentMethodBaseRequest diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodBaseResponse.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodBaseResponse.cs index 5acb5ee..64193b8 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodBaseResponse.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodBaseResponse.cs @@ -1,6 +1,8 @@ using System.Text.Json.Serialization; using Mercoa.Client; +#nullable enable + namespace Mercoa.Client; public class PaymentMethodBaseResponse @@ -21,7 +23,7 @@ public class PaymentMethodBaseResponse public bool IsDefaultDestination { get; init; } [JsonPropertyName("supportedCurrencies")] - public List SupportedCurrencies { get; init; } + public IEnumerable SupportedCurrencies { get; init; } [JsonPropertyName("createdAt")] public DateTime CreatedAt { get; init; } diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodType.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodType.cs index c171383..3330feb 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodType.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/PaymentMethodType.cs @@ -1,7 +1,13 @@ using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Mercoa.Client; +using Mercoa.Client.Core; + +#nullable enable namespace Mercoa.Client; +[JsonConverter(typeof(StringEnumSerializer))] public enum PaymentMethodType { [EnumMember(Value = "custom")] diff --git a/src/Mercoa.Client/PaymentMethodTypes/Types/PlaidLinkRequest.cs b/src/Mercoa.Client/PaymentMethodTypes/Types/PlaidLinkRequest.cs index 924d3de..6e09cef 100644 --- a/src/Mercoa.Client/PaymentMethodTypes/Types/PlaidLinkRequest.cs +++ b/src/Mercoa.Client/PaymentMethodTypes/Types/PlaidLinkRequest.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; +#nullable enable + namespace Mercoa.Client; public class PlaidLinkRequest